Operator precedence, the difference between / and //, and how operand types decide the result type of every expression.
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
Assign the value of the expression 7 + 3 * 2 to result.
Don't work it out in your head and type the number — write the expression itself on the right-hand side of the = and let Python collapse it.
Reduction of an expression to a single value
Write the object operator object form and trace type(3 + 2) collapsing to type(5) and then to int, recording that only the resulting value is kept in memory.
Which operators return int and which float
Tabulate + - * // % ** as int only when both operands are int and / as always float, with 5 // 3 giving 1, 5 % 3 giving 2, 2 ** 3.0 giving 8.0.
Precedence order and the parenthesis override
Rank ** above *, /, // and %, and those above + and -, then evaluate 13 - 4 / 12 * 12 step by step down to 0.0625.