How does building sum_odds step by step expose the off-by-one bug hiding inside range — and why is solving the easier version first the winning move?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
range(start, stop) produces the integers starting at start but stops before stop — it never includes stop itself. Using a = 2 and b = 6 below, assign to nums the list of every integer from a up to and including b.
Hint: range(start, stop) stops one short of stop, and list(...) turns a range into a list.