How can 5×4 become 5 + 5×3 — and why does that one rewrite of the same problem make the loop disappear entirely?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
Here is the while-loop version of multiplication from the video:
def mult_iter(a, b): result = 0 while b > 0: result += a b -= 1 return result
Run mult_iter(7, 3) in your head. Every time the loop body finishes, result is holding a new value. Assign to trace a list of those values, in the order they appear — one entry per completed pass, and do not include the starting 0.