Best afterNumbers have types: int vs float

Operator precedence: × before +

Python doesn't read arithmetic left to right — it follows the usual maths rules, doing multiplication before addition. If you meant the addition to happen first, you have to say so. Watch the same numbers give two different totals.

Add base (2) and extra (3), then multiply the sum by 4 (we want 20).

Forgetting the parentheses execution-derived · CPython
variables
state after line 1 runs
variablevalue
base2
step 1 / 3

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

What you are looking at

Watch result: the order the operators run in decides the answer.

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