Give

Variables

Store values in named variables, and change them to change what a program does.

A sample lesson from this module is playable in the demo. The full module is not written yet; it is not a finished course.

COCO-PRG-PYB-0202Level7–9

Why it matters

A shopkeeper keeps a running count of the bags of rice left. A variable is a named place where a program keeps a value like that and changes it.

Draft outline · in review
For
Level 7–9 · JSS 1 to JSS 3 (BECE)
Inside
5 lessons and a test · about 60 minutes
Topic
Python basics · foundation, 1 of 4
Plate CO-PRG-PYB-02: sample lesson in the demo.

Inside the module.

5 lessons in order, about 60 minutes in all, then a short test. Learners go at their own pace; the minutes are a guide, not a timetable.

Draft outline · in review

  1. Lesson 1: Names for values

    A variable is a name that points to a value, set with =.

    Explain10 min, from minute 0

  2. Lesson 2: Rice in the shop

    Track bags of rice as they are sold and delivered.

    Worked example15 min, from minute 10

  3. Lesson 3: Change a value

    Change variables and predict what each program prints.

    Practice20 min, from minute 25

  4. Lesson 4: Good names

    Why bags_left is clearer than x, and Python's naming rules.

    Discussion10 min, from minute 45

  5. Lesson 5: Check your skills

    Short prediction and naming questions.

    Review5 min, from minute 55

  6. End-of-module test

    Store and change values in well-named variables and predict what short programs print.

    Mastered at 85% or more. Retake it until you pass; nothing is lost, and each try gives feedback.

    Already know it? A Challenge Test (planned) clears the whole module: 90% overall, no objective below 75%.

    Last stageafter about 60 min

Practicalities

Draft outline · in review
  • Built to run offline

    Planned to run on the Lantern's own computer, with no internet needed.

  • Languages

    Planned first in English; every module aims to reach all of the Lantern's languages.

Try a question.

One question from the module, as a learner would meet it. Have a go, then open the worked solution a step at a time.

Draft outline · in review

What does this print? bags = 10 bags = bags - 3 print(bags)

Work it out on paper first, then show the answer and mark it yourself.

Particulars

What a learner can do after it

  1. Store a value in a named variable.
  2. Change a variable's value to change what a program does.
  3. Choose clear variable names.

Level

Level 7–9 · JSS 1 to JSS 3 (BECE)

Show levels in

Level mappings are approximate. A qualified teacher or lecturer in each country must check them before they appear in the app.

Difficulty for its level

1 of 4 · Foundation

Time

About 60 minutes

Alignments

  • Aligned to CSTApartial · in review2-AP-11
  • Aligned to PCEPpartial · in reviewPCEP: variables (descriptive ref)

Alignment in review until a qualified teacher or lecturer checks it. No exam body, university or vendor endorses us; learners still sit the real exam.

Challenge Test

Planned: a Challenge Test to prove you know it and skip it. Pass at 90% overall, with no objective below 75%.

University courses it previews

Computer Science, Software Engineering

The route here.

Everything this module builds on, drawn as a route from its foundations. Solid lanes must be mastered first, or cleared by a Challenge Test; dashed lanes are suggestions that never lock anything.

  1. CO-BLK-SEQ-01Instructions in orderCoding · Primary 1 to Primary 4 (Level 1–4) · Planned
  2. CO-BLK-LOP-01Repeat blocksCoding · Primary 3 to Primary 5 (Level 3–5) · Sample lesson in the demo Needs Instructions in order (required).Try the sample lesson: Repeat blocks
  3. DS-CMP-TYP-01The home rowDigital skills · Primary 3 to Primary 6 (Level 3–6) · Planned · recommended
  4. CO-BLK-LOP-02Patterns with loopsCoding · Primary 4 to Primary 6 (Level 4–6) · Planned Needs Repeat blocks (required).
  5. CO-PRG-PYB-01Your first Python programCoding · JSS 1 to JSS 3 (BECE) (Level 7–9) · Planned Needs Patterns with loops (required), The home row (recommended).
  6. CO-PRG-PYB-02VariablesCoding · JSS 1 to JSS 3 (BECE) (Level 7–9) · Sample lesson in the demo · the destination Needs Your first Python program (required).Try the sample lesson: Variables
6 stops across Coding and Digital skills. 2 have a sample lesson in the demo; the other 4 are planned and not yet written.

Help light the room where this is learned.

Every route on this map starts in a classroom with 24 stations, a tutor that works offline and a facilitator upstairs. Four are planned and waiting for light.