CurriculumWhat the Dragon Remembers

Python Variables for Kids

A variable is a name Python remembers a value by, so the same value can be used again without writing it out every time.

18 exercises5 lessonsAges 10+Free
Start this topic →

What this topic covers

Variables are usually explained as 'boxes that hold things', and that picture is good enough to start with — this topic uses it. What matters more is what children do with them: naming a value, reading it back, and then updating it using its own previous value, which is the step where the box picture starts doing real work.

The line score = score + 10 is where most beginners stall, because it looks like a false statement in mathematics. Read as an instruction rather than an equation, it makes sense immediately, and the topic spends real time on that reading rather than assuming it is obvious.

By the end, a child is holding several variables at once and combining them into printed sentences and stat sheets — the point where variables stop being an exercise and start being useful.

Python from this topic

gold = 40
gold = gold + 2
print("Gold:", gold)

Output

Gold: 42

Python covered here

  • Assigning a value to a name
  • Reading a variable back with print()
  • Updating a variable using its own value
  • Choosing clear variable names
  • Using several variables in one print()
  • Combining text and numbers in output

The mistake this topic is built to fix

Common mistakeA child reads score = score + 10 as an equation and objects that it cannot be true.

In mathematics it would be false. In Python, = means 'work out the right side, then store it under this name'. The topic makes the order of those two steps explicit instead of leaving a child to infer it.

The lessons, in order

  1. The dragon remembersBoxes that hold things — and how to look inside them.4 exercises
  2. Changing what's rememberedBoxes can be updated — reading the old value to make the new one.4 exercises
  3. Boxes and print, togetherSeveral boxes at once — sentences, stat sheets, and combined totals.4 exercises
  4. The Dragon's Full SheetEverything you know about boxes, at once.3 exercises
  5. Swapping and Tracingleft, right = right, left swaps two boxes in one line — and why the obvious two-line swap actually fails.3 exercises

Lessons unlock in order within a topic, so nothing arrives before the idea it depends on. This topic is free, start to finish.

Try it now

The very first level needs no account at all — see whether it clicks before signing up for anything.

Play the first level free →