Values and names

A variable is a name pointing at a value, not a box that remembers everything you ever put in it. Rebind the name and the old value is gone — unless you saved it somewhere first. Step through both versions and watch the names move.

price starts at 5, then becomes 7. Add the original price and the new price together (we want 5 + 7 = 12).

Reusing a name — the old value is gone execution-derived · CPython
variables
state after line 1 runs
variablevalue
price5
step 1 / 3

Click a line, drag the slider, or use the keys.

What you are looking at

Keep your eye on price: one name, one value at a time.

Every state you see came from running the program under CPython's tracer at build time — see how GlassBox stays honest.