Lesson 1 · Python Foundation
Naming and storing values.
A variable in Python is what it was in Scratch and JavaScript — a named box holding a value.
The only difference is how little you type:
score = 0
player_name = "Ananya"
lives = 3
No let, no set block, no semicolons. Name, equals sign, value. Python works out whether it's a number or text by itself.
This trips up everyone who learned maths first.
In maths, x = x + 1 is nonsense — nothing equals itself plus one.
In programming, = means "put this value into this box", working right to left:
score = score + 1
Read it as: take what's in score, add 1, put the result back into score. Not a statement of fact — an instruction.
When you later need to check whether two things are equal, you'll use ==, and that difference matters enormously.
6 more parts in this lesson
Walkthroughs, code labs, mini-games and the checkpoint quiz unlock when you buy the course.