🐍 Python for beginners · session 3 of 58 · 60 minutes · free
Practice class: print and variables (homework pack)
A practice class for Grade 6. No new big ideas: just print() and variables, used again and again until they feel easy. Play the warm-up games, fill in the boilerplate code step by step, then take the homework pack home. Every task checks itself.
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
- Print warm-up6 min
- Variables7 min
- Text and f-strings7 min
- Tracing and swaps6 min
- Game character card7 min
- Cricket scoreboard7 min
- Recipe scaler5 min
- Quiz5 min
- Set the after-class activity2 min
By the end you can
- Print text, numbers and patterns exactly, using commas, sep and end
- Make, use and change variables with = and +=
- Build sentences from variables with f-strings
- Trace a program line by line and swap two variables
- Fill in a boilerplate program step by step and test it
Before you start
- Session 1: print(), text and comments
- Session 2: variables (helpful, but each idea is recapped here)
Have ready
- This page (nothing to install)
- A notebook for the trace tables
Beginner · ages 10 and up
Warm-up · think first
Mystery boxes! a = 5, then b = a, then a = 9. What is inside b now: 5 or 9?
Show the answer
5. When b = a runs, b gets a copy of the 5 inside a. Changing a afterwards puts a new value in a's box only; b keeps its own 5.
Teacher tip: Take a vote first. Then draw two boxes, a and b, and update them line by line. Most learners say 9.
🎮 Warm-up games · 6 quick games
Play with Bolt the robot
Five minutes, six quick games. Pick an answer, then press Show the answer. Spin the wheel for a random one.
- Which one doesn't belong? (print("hi") · Print("hi") · print('hi') · print("h" + "i"))
Answer: Print("hi") is the odd one: the capital P makes an error. Every other line prints hi. (print('hi') is the only one with single quotes, and that is fine too.) - Would you rather start with coins = 50 and then coins += 25, or coins = 100 and then coins -= 30? (coins = 50, then coins += 25 · coins = 100, then coins -= 30)
Answer: A: 50 + 25 = 75 coins beats 100 − 30 = 70 coins. - print(a + b) shows a number. (Always · Sometimes · Never)
Answer: Sometimes. If a = 2 and b = 3 it shows 5. If a = "2" and b = "3" it joins the text and shows 23, which is text, not a number! - How many characters does print("ha" * 12) show? Make a smart guess.
Answer: 24 characters: "ha" has 2 letters and it is repeated 12 times. - How many different ways can you make Python print 12?
Answer: Lots! print(12), print(6 * 2), print(3 + 9), print("12"), print("1" + "2"), x = 12 then print(x), print(f"{12}") … - x = 3, then x = x * x, then x = x + x. What is in x at the end?
Answer: 18. x becomes 3 × 3 = 9, then 9 + 9 = 18.
Part 1 of 4 · learn, see, practise
Print warm-up: lines, commas, sep and end
print() shows what is inside its brackets and then moves to a new line. Text goes in quotes; numbers and sums do not.
A comma prints several things with a space between them. sep= changes that space: print(1, 2, 3, sep="-") shows 1-2-3.
end= changes what comes after the line. print("Wait", end="") stays on the same line, so the next print carries on from there.
▶ Output
Hi there 5/11/2026 Loading... ============
📦 Memory boxes
Line 2 joins the numbers with / instead of spaces. Lines 3 and 4 make one line together, because of end="".
Practise it
Start with the warm-up and go as far as you can. The stretch questions are meant to be hard.
1.1 Print exactly: Python is fun!
▶ Output
(nothing is printed)
📦 Memory boxes
Model answer (for the teacher)
print("Python is fun!")1.2 Print a line of 12 = signs, then GAME OVER, then 12 = signs again. Use * for the repeats.
▶ Output
(nothing is printed)
📦 Memory boxes
Model answer (for the teacher)
print("=" * 12)
print("GAME OVER")
print("=" * 12)1.3 Print the time 12:30:45 using print(12, 30, 45, …) and sep.
▶ Output
(nothing is printed)
📦 Memory boxes
Model answer (for the teacher)
print(12, 30, 45, sep=":")1.4 Use four print() calls and end= to print one single line: 3... 2... 1... Go!
▶ Output
(nothing is printed)
📦 Memory boxes
Model answer (for the teacher)
print("3...", end=" ")
print("2...", end=" ")
print("1...", end=" ")
print("Go!")Part 2 of 4 · learn, see, practise
Variables: make them, use them, change them
A variable is a named box that holds a value: lives = 3. The = means "put the value on the right into the box on the left".
To change a box using its old value: lives = lives + 1, or the shortcut lives += 1. Also -= and *=.
A good program uses its variables everywhere, so changing one value at the top changes every answer below it.
▶ Output
Coins: 10 Coins now: 30
📦 Memory boxes
30intWatch the memory box: coins goes 10 → 15 → 30. Change the first line to 100 and run again.
Practise it
Start with the warm-up and go as far as you can. The stretch questions are meant to be hard.
2.1 The variable player is ready. Print Player: and the player's name, using the variable.
▶ Output
(nothing is printed)
📦 Memory boxes
'Aarav'strModel answer (for the teacher)
player = "Aarav"
print("Player:", player)2.2 Make a variable called lives that holds 3, then print it.
▶ Output
(nothing is printed)
📦 Memory boxes
Model answer (for the teacher)
lives = 3
print(lives)2.3 You lose one life, then win two. Change lives with -= and += and print it.
▶ Output
(nothing is printed)
📦 Memory boxes
3intModel answer (for the teacher)
lives = 3
lives -= 1
lives += 2
print(lives)2.4 c holds a temperature in °C. Make f = c * 9 / 5 + 32 and print it like this: 30 C is 86.0 F
▶ Output
(nothing is printed)
📦 Memory boxes
30intModel answer (for the teacher)
c = 30
f = c * 9 / 5 + 32
print(c, "C is", f, "F")Part 3 of 4 · learn, see, practise
Text in variables and f-strings
Variables can hold text too: city = "Pune". + joins two pieces of text with no space, so add " " yourself.
An f-string fills in variables for you: f"I live in {city}." Put f before the quote and the variable in curly brackets.
len(word) counts the characters in a text; word.upper() gives it in CAPITALS.
▶ Output
Sara Khan Sara Khan has 9 characters. SARA KHAN
📦 Memory boxes
'Sara'strlast'Khan'strfull'Sara Khan'strThe space between the names counts as a character too: 9 in all.
Practise it
Start with the warm-up and go as far as you can. The stretch questions are meant to be hard.
3.1 Print I live in Durgapur. with an f-string and the variable city.
▶ Output
(nothing is printed)
📦 Memory boxes
'Durgapur'strModel answer (for the teacher)
city = "Durgapur"
print(f"I live in {city}.")3.2 Print the name surname first, like a register: Sen, Riya
▶ Output
(nothing is printed)
📦 Memory boxes
'Riya'strlast'Sen'strModel answer (for the teacher)
first = "Riya"
last = "Sen"
print(f"{last}, {first}")3.3 Print two lines: python has 6 letters. and then the word in capitals. It must work for any word.
▶ Output
(nothing is printed)
📦 Memory boxes
'python'strModel answer (for the teacher)
word = "python"
print(f"{word} has {len(word)} letters.")
print(word.upper())Part 4 of 4 · learn, see, practise
Trace it: updates, swaps and memory boxes
To trace a program, go one line at a time and write the value in every box. Only the newest value counts.
To swap two variables you need a spare box (temp = a, a = b, b = temp), or Python's shortcut: a, b = b, a.
▶ Output
9 4 Total: 14
📦 Memory boxes
9intb4inttotal14intAfter line 3, a holds 9 and b holds 4. Check the memory boxes.
Practise it
Start with the warm-up and go as far as you can. The stretch questions are meant to be hard.
4.1 Trace the program on paper first, then add a line that prints x.
▶ Output
(nothing is printed)
📦 Memory boxes
20intModel answer (for the teacher)
x = 2
x = x + 3
x = x * 4
print(x)4.2 Swap left and right, then print left and right on one line (it should show dog cat).
▶ Output
cat dog
📦 Memory boxes
'cat'strright'dog'strModel answer (for the teacher)
left = "cat"
right = "dog"
left, right = right, left
print(left, right)4.3 Rotate three boxes: a takes b's value, b takes c's and c takes a's old value. Print a, b, c on one line (2 3 1).
▶ Output
1 2 3
📦 Memory boxes
1intb2intc3intModel answer (for the teacher)
a = 1
b = 2
c = 3
a, b, c = b, c, a
print(a, b, c)Watch out
Common mistakes
Quotes around a variable
print("name") prints the word name. print(name) prints what is inside the box.
Joining text and a number with +
"Age: " + 12 stops with an error. Use a comma, an f-string, or str(12).
Forgetting the f
"Hi {name}" prints the curly brackets. f"Hi {name}" fills them in.
Using a box before making it
print(score) before score = 0 stops with a NameError: make the box first.
Class activity 1 of 3
Game character card
Finish the boilerplate so it prints this card, then levels the hero up:
=========================
HERO: Zara
Level: 3
Health: ♥♥♥♥♥
Coins: 120
=========================
Level up! Zara is now level 4 with 170 coins.
- Print the top border: 25 = signs, using *.
- Print HERO:, Level: and Coins: lines from the variables (f-strings are easiest).
- Print Health: followed by one ♥ for each point of hp, using "♥" * hp.
- Print the bottom border.
- Level up: add 1 to level and 50 to coins with +=, then print the level-up line.
▶ Output
HERO: Zara
📦 Memory boxes
'Zara'strlevel3inthp5intcoins120intHint
print("Health: " + "♥" * hp) joins the label and the hearts. For the last line: f"Level up! {name} is now level {level} with {coins} coins."
Model answer (for the teacher)
name = "Zara"
level = 3
hp = 5
coins = 120
print("=" * 25)
print(f"HERO: {name}")
print(f"Level: {level}")
print("Health: " + "♥" * hp)
print(f"Coins: {coins}")
print("=" * 25)
level += 1
coins += 50
print(f"Level up! {name} is now level {level} with {coins} coins.")Class activity 2 of 3
Cricket scoreboard
Run a two-over match with variables. Over 1: a four, a six and a single. Over 2: a two and a wicket. Then print:
India: 13/1 in 2 overs
Run rate: 6.5
- Over 1: add 4, 6 and 1 to runs with +=, and add 6 to balls.
- Over 2: add 2 to runs, 1 to wickets and 6 to balls.
- Work out overs = balls // 6.
- Print the score line with an f-string.
- Print the run rate: runs / overs.
▶ Output
(nothing is printed)
📦 Memory boxes
'India'strruns4intwickets0intballs0intHint
Each ball event is one line, like runs += 6. The score line is f"{team}: {runs}/{wickets} in {overs} overs".
Model answer (for the teacher)
team = "India"
runs = 0
wickets = 0
balls = 0
runs += 4
runs += 6
runs += 1
balls += 6
runs += 2
wickets += 1
balls += 6
overs = balls // 6
print(f"{team}: {runs}/{wickets} in {overs} overs")
print(f"Run rate: {runs / overs}")Class activity 3 of 3
Recipe scaler
One person needs 100 g of rice and 200 ml of water, and every 2 people need 1 spoon of salt. Fill in the boilerplate so it works for any number of people. For 4 people:
Cooking for 4 people
Rice: 400 g
Water: 800 ml
Salt: 2 spoons
- Work out rice = rice_each * people and water = water_each * people.
- Work out salt = people // 2.
- Print the four lines with f-strings.
- Change people to 6 and check: 600 g, 1200 ml, 3 spoons.
▶ Output
Cooking for 4 people
📦 Memory boxes
4intrice_each100intwater_each200intrice0intHint
rice = rice_each * people. salt = people // 2 gives whole spoons.
Model answer (for the teacher)
people = 4
rice_each = 100
water_each = 200
rice = rice_each * people
water = water_each * people
salt = people // 2
print(f"Cooking for {people} people")
print(f"Rice: {rice} g")
print(f"Water: {water} ml")
print(f"Salt: {salt} spoons")After class · project
My pocket money tracker (after-class activity)
Finish this boilerplate at home. It tracks your money for one week and prints a neat report. Every TODO is one or two lines. Run it after each step!
What to make: A program with no errors that prints a report of at least 8 lines, all worked out from the variables.
Stretch: Add a variable weeks = 4 and print how much you would save in 4 weeks if every week were the same.
How it is marked
| Look for | Done well when |
|---|---|
| Runs | No errors when you press Run |
| Variables | Every number in the report comes from a variable |
| f-strings | The report lines use f-strings |
| Test | Change one number at the top and the report still adds up |
Starter code to take home
Press Copy and paste it into the editor at home, or work on it right here.
▶ Output
============================== Your name's money report ============================== Started with: Rs 200
📦 Memory boxes
'Your name'strstart_money200intbirthday_gift100intsnacks45intbooks60intmoney300intgoal500intHomework
Practise at home
Each one checks itself. Or print the practice sheet.
1. Hello card. Put your name in the box, then print two lines: Name: … and Grade: 6, using the variables.
▶ Output
(nothing is printed)
📦 Memory boxes
'Aisha'strgrade6int2. Star strip. Print a line of size stars, then the sentence That was 7 stars (using size both times).
▶ Output
(nothing is printed)
📦 Memory boxes
7int3. Pizza party. Print Total slices: …, Each friend gets: … (whole slices) and Left over: ….
▶ Output
(nothing is printed)
📦 Memory boxes
3intslices_each8intfriends5int4. Cycle ride. A cyclist rides distance km in time hours. Print Speed: 12.0 km/h (speed = distance / time).
▶ Output
(nothing is printed)
📦 Memory boxes
36inttime3int5. Shelf shuffle. Move the books: top gets bottom's book, middle gets top's old book and bottom gets middle's old book. Then print the three shelves.
▶ Output
Top: maths Middle: science Bottom: english
📦 Memory boxes
'maths'strmiddle'science'strbottom'english'str6. Digital clock. total holds seconds. Print it as hours:minutes:seconds, like 1:06:40. Hint: f"{m:02d}" shows 6 as 06.
▶ Output
(nothing is printed)
📦 Memory boxes
4000int🔥 Challenge round · finished early?
The hardest questions of the lesson, no notes
Cover the notes and try these from memory. They are meant to make you think hard: draw, try small cases, and check your answer.
- Stretch task 1: Use four print() calls and end= to print one single line: 3... 2... 1... Go!
- Stretch task 2: c holds a temperature in °C. Make f = c * 9 / 5 + 32 and print it like this: 30 C is 86.0 F
- Stretch task 3: Print two lines: python has 6 letters. and then the word in capitals. It must work for any word.
- Stretch task 4: Rotate three boxes: a takes b's value, b takes c's and c takes a's old value. Print a, b, c on one line (2 3 1).
🧠 Think-hard question
Make a variable n = 4729 and print its digits backwards (9274) using only // and %, so it works for any 4-digit number.
Talk it through or use the drawing board. There is more than one way to get there.
Quiz · 10 questions
Final quiz: check what you learned
Pick an answer to see if it is right and why. Your best score is saved on this device.
🖨 Print what we learned
Make a worksheet from this lesson
Pick what to practise, then print it or choose Save as PDF in the print window to download it.
For parents and teachers
The 60-minute lesson plan
Use it as it is, or stretch any part over two sessions. Each row links to the part of the page you need.
| Time | Part | The teacher | The learner |
|---|---|---|---|
| 0–3 min | Warm-up | Vote on the mystery boxes before revealing. | Guess, then trace. |
| 3–8 min | Warm-up games | Play three or four games; spin the wheel for the last one. | Pick, explain, reveal. |
| 8–14 min | Print warm-up | Run the example, then race through the tasks. | Do tasks up to the countdown. |
| 14–21 min | Variables | Change the first line of the example and re-run. | Do the temperature task. |
| 21–28 min | Text and f-strings | Count the characters in the full name together. | Finish the capitals task. |
| 28–34 min | Tracing and swaps | Draw the trace table on the drawing board. | Swap and rotate. |
| 34–41 min | Game character card | Show the boilerplate and the TODOs; let them press Check often. | Build the card. |
| 41–48 min | Cricket scoreboard | Do over 1 together, then let them finish. | Match the scoreboard. |
| 48–53 min | Recipe scaler | If time is short, add it to the homework. | Scale the recipe. |
| 53–58 min | Quiz | Read each code aloud; vote, then check. | Answer and read why. |
| 58–60 min | Set the after-class activity | Open the tracker boilerplate, agree a due date, and point to the homework pack. | Copy the boilerplate. |
Questions to ask
- What is the difference between print(name) and print("name")?
- Why does a good program use its variables instead of typing the numbers?
- How do you swap two variables?
If it feels hard
Do level 1 and 2 tasks together, typing each line aloud. Give the activities one TODO at a time and press Check after each.
If it feels easy
Make a variable n = 4729 and print its digits backwards (9274) using only // and %, so it works for any 4-digit number.
FAQ
Practice class: print and variables (homework pack): questions
Is this Python practice right for Grade 6?
Yes. It is written for learners of about 11 and 12 who have met print() and variables. Each task has a warm-up, core and stretch level, so stronger learners are stretched too.
What is boilerplate code?
A ready-made program with the structure already written and TODO comments where the learner fills in a line or two. It keeps the focus on the idea being practised instead of a blank screen.
Can students do the homework on their own?
Yes. Every homework task runs on this page and checks itself, with clear messages when something is not right yet. A printable sheet is available too.
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