60-sec Short Variables 60 sec

Variables: Magic Boxes!

How does a game remember your score?

Real Python code

This is the code from the video. Read it out loud like a recipe, one line at a time!

score.py
score = 0
for point in range(3):
    score = score + 1
print(score)

Quiz time!

What does this print?

quiz.py
box = 5
box = 2
print(box)

Try it yourself!

In Scratch, make a variable called score and change it by 1 each time your sprite is clicked.

Bit is working on the next one: Lists: boxes in a row

Liked this quest?

Subscribe to see the next one first! Ask a grown-up before subscribing.

Keep exploring