Variables as Storage Boxes
A variable is a labelled storage box your program can use again.
Discover
- Names can store text or numbers.
- Variable names should be meaningful.
- Changing a stored value changes later output.
Try, explain and change
Try: Create a fictional language tracker: store “Python” in language and 3 in lessons, then print “Python 3”. Use both variables in the print call.
Change: Increase lessons to 4. What changed in the output?
Try the challenge
Create a fictional language tracker: store “Python” in language and 3 in lessons, then print “Python 3”. Use both variables in the print call.
Python 3Match the lines and order. Your code must use the lesson concept.
The runner supports this pathway’s controlled Python concepts while blocking packages, files, networks and system commands.
Your output will appear here.
Find the bug
favourite language = "Python" print(favourite language)
Show debugging clue
Variable names cannot contain spaces; try favourite_language.
Which is a valid variable name?
my score
Not this time. Review Discover and try again.
my_score
Correct — well reasoned.
3score
Not this time. Review Discover and try again.
Create and reflect
Create: Make a character profile with a name, power and score.
Reflect: How do meaningful variable names help a programmer?
Add a goal variable with a value of 5 and print the number of lessons still needed.
Edit and run your code again to explore this variation. It does not change lesson completion.