Best afterNumbers have types: int vs float

Converting a float to an int

Turning a decimal into a whole number sounds like rounding — but Python's int() doesn't round. Watch 3.9 become two different whole numbers depending on which function you reach for.

Round the measurement 3.9 to a whole number (we want 4).

int() truncates, it doesn't round execution-derived · CPython
variables
state after line 1 runs
variablevalue
measurement3.9
step 1 / 2

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

What you are looking at

Watch rounded — does 3.9 become 3 or 4?

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