Step 1 of 6

Step 1 · Read and run

Your first variable

So far, every value went straight into print() and was gone. A variable keeps a value, with a name on it, so you can use it again.

name = "Sam"

Read the = as becomes: "name becomes Sam". Python stores "Sam" in a box labelled name. From then on, writing name (no quote marks) means "whatever is in that box".

Run it: one value, stored once, printed twice.

Run the program to carry on.
first.py

Output

Press Run to see what your program prints.