🤖 Python Grade 5 · session 3 of 44 · 60 minutes · 🎁 free with an account
Variables: Bolt's labelled boxes
Bolt has a shelf of labelled boxes. Put a number or a name in a box, change it, and use it again and again. This is how every game keeps your score.

A complete lesson · 60 minutes
Teach it, see it, practise it, all on this page.
Open this page with your learner and work down it, or press Teach this lesson to go through it one step at a time on a big screen. Every section has something to do.
- Warm-up3 min
- Warm-up games5 min
- Make a box with =9 min
- Change what's in the box9 min
- f-strings: fill in the blanks9 min
- Game score keeper7 min
- Silly story machine7 min
- Swap the cups5 min
- Quiz5 min
- Set the after-class project1 min
By the end you can
- Make a variable with =
- Change a variable and see the new value
- Use += to add to a score
- Print sentences with f-strings
Before you start
- Lesson 1: print()
- Lesson 2: sums in Python
Have ready
- This page
- Sticky notes or paper boxes (optional)
Grade 5 · ages 10 and 11 · no experience needed
Warm-up · think first
A box is labelled coins. It holds 5. You throw that away and put in 9. What is in the box now?
Show the answer
9. A box holds one thing at a time, and the newest thing replaces the old one.
Teacher tip: Use a real box or a cup with a sticky note.
🎮 Warm-up games · 5 quick games
Play with Bolt the robot
Five minutes with Bolt the robot. Vote, say why, then show the answer.
- Which is the best label for a box holding your score? (score · x · my score · 2score)
Answer: score is best: it says what's inside. A label with spaces won't work in Python, and x tells you nothing. - Would you rather have coins = 10 then coins + 5, or coins = 20 then coins - 3? (10, then add 5 · 20, then take 3)
Answer: Start with 20 and take 3: that leaves 17, which beats 15. - A variable keeps its first value for ever. (Always · Sometimes · Never)
Answer: Never — Never. You can change it whenever you like. Only the newest value stays. - lives = 3, then lives = lives - 1, then lives = lives - 1. How many lives are left?
Answer: 1. Take one away, then take one away again. - What does a game need to remember while you play?
Answer: Score, lives, level, your name, the time. Each of these is a variable!
Three levels, like a real engineer
Use it. Tweak it. Build it.
First use what the lesson shows exactly as it is, then change one key thing and see what happens, then make your own.
- 🔒
Level 1 · Use it
Run it as it is
Run this exact code: score = 10, score += 5, print(f'Bolt score is {score}'). Notice what number shows up in the sentence.
- 🔧
Level 2 · Tweak it
Change one value
In that code, change 10 to 20 and 5 to 3. Predict Bolt's new score sentence, then run it. Did the f-string update?
- 🛠️
Level 3 · Build it
Write your own
Make your own labelled box for a pet's age. Add 1 with +=, then print an f-string like 'Rex age is {age}'. Run it and check.
Part 1 of 3 · learn, see, practise
Make a box with =
This is my shelf of boxes. score = 10 means: make a box, label it score and put 10 inside. Watch the memory boxes under the code!
A variable is a labelled box. score = 10 puts 10 in a box called score.
No quotes around the label when you use it: print(score) shows 10, and print("score") shows the word.
Labels use small letters and no spaces: my_score is fine, my score is not.
🧑🏫 Teacher: type this live with the class
Fill Bolt's boxes
name = "Bolt"Run it. Nothing prints, but look under the code: a box called name! Text still needs quotes.
score = 10Another box. Numbers don't need quotes.
print(name)No quotes around name, so Python looks in the box.
print(score)Ask: what will this show?
print("score")With quotes it's just the word. Spot the difference.
▶ Output
(nothing is printed)
📦 Memory boxes
▶ Output
tiger 4 A tiger has 4 legs
📦 Memory boxes
'tiger'strlegs4intChange the first two lines to your own pet. Only two changes update the whole sentence!
Puzzle break: what's in the box?
Hands off the keyboard for two minutes. Read the code the way Bolt does, one line at a time.
- Puzzle 1: say what happens before you run it
- Puzzle 2: put the lines in order
- Puzzle 3: find the bug
Practise it
Start with the warm-up and go as far as you can. The stretch questions are meant to be hard.
1.1 Make a box called age holding 10, then print it.
▶ Output
(nothing is printed)
📦 Memory boxes
🧑🏫 Model answer (for the teacher)
Teacher eyes only: hide the answers before you share your screen.
The answer green = the 2 lines the student writes
age = 10print(age)
What it prints
10
What ✓ Check looks for
- it prints exactly:
10
- In the code: Start with age = 10.
1.2 Make a box called colour holding the word blue, then print it.
▶ Output
(nothing is printed)
📦 Memory boxes
🧑🏫 Model answer (for the teacher)
Teacher eyes only: hide the answers before you share your screen.
The answer green = the 2 lines the student writes
colour = "blue"print(colour)
What it prints
blue
What ✓ Check looks for
- it prints exactly:
blue
- In the code: Print the box: print(colour).
1.3 The boxes are ready. Print exactly: Mia is 11, using the boxes and a comma.
▶ Output
(nothing is printed)
📦 Memory boxes
'Mia'strage11int🧑🏫 Model answer (for the teacher)
Teacher eyes only: hide the answers before you share your screen.
The answer green = the 1 line the student writes
name = "Mia"age = 11print(name, "is", age)
What it prints
Mia is 11
What ✓ Check looks for
- it prints exactly:
Mia is 11
- With
name = "Om", it prints exactly:Om is 11
1.4 width is 6 and height is 4. Make a box area holding width * height and print it.
▶ Output
(nothing is printed)
📦 Memory boxes
6intheight4int🧑🏫 Model answer (for the teacher)
Teacher eyes only: hide the answers before you share your screen.
The answer green = the 2 lines the student writes
width = 6height = 4area = width * heightprint(area)
What it prints
24
What ✓ Check looks for
- it prints exactly:
24
- With
width = 10, it prints exactly:40
1.5 price is 25 and count is 8. Print exactly: Total: 200 rupees. It must still work if the boxes change.
▶ Output
(nothing is printed)
📦 Memory boxes
25intcount8int🧑🏫 Model answer (for the teacher)
Teacher eyes only: hide the answers before you share your screen.
The answer green = the 1 line the student writes
price = 25count = 8print("Total:", price * count, "rupees")
What it prints
Total: 200 rupees
What ✓ Check looks for
- it prints exactly:
Total: 200 rupees
- With
count = 2, it prints exactly:Total: 50 rupees
🎁 Free for a year
Make a free account to open the rest of this lesson
Every new account opens every lesson of every course free for a whole year: no payment, no card, nothing to cancel.
Unlocking the rest of this lesson gives you:
- Part 2: Change what's in the box, with practice at three levels
- Part 3: f-strings: fill in the blanks, with practice at three levels
- Class activity 1: Game score keeper
- Class activity 2: Silly story machine
- Class activity 3: Swap the cups
- A 8-question quiz
- After-class project: My game character card
- Homework and a printable practice sheet with answers
- Teach mode and the minute-by-minute teacher's plan
It takes a minute. Anyone under 13 signs up with a parent. The first 2 lessons of every course, every game and all maths practice stay free.
FAQ
Variables: Bolt's labelled boxes: questions
What is a variable in simple words?
A labelled box that remembers something for your program, like a score or a name.
What is an f-string?
A sentence with blanks. Put f before the quotes, and Python fills in anything inside curly brackets.
Why does my program say NameError?
It means Python can't find a box with that label. Check the spelling, and make the box above the line that uses it.
Start a conversation
Want a teacher to take this class?
Tell us the learner's age and level. A teacher from our network teaches with these lessons; we confirm timing and price first.
- Tell us the learner’s age or grade and goals
- We’ll suggest a suitable class or learning path
- We’ll confirm format, timing and fees with a parent or guardian