drag to orbit ยท scroll to zoom
โ† Playground

๐Ÿ“ฆ The Variable Box

A variable is a box with a name stuck on the front, and a value inside. Assigning doesn't change the name โ€” it swaps what's inside.

name =x
value =โ€”
Assign something
The box is empty. Assign a value to it.
Python code
x = 5

๐Ÿ’ก The name (the label) stays the same every time. Only the value inside changes. x = x + 1 reads the old value, adds one, puts it back.