Loop Traps
Off by one, and the loop that never ends
About 40 minutesMediumTurtle and Code
What your child can do at the end
Explain why range(a, b) stops before b
The brief
Two loop mistakes catch everyone, including professionals. The first is off by one: your loop runs one time too few or one too many. The second is the loop that never stops, because nothing inside it changes the thing the test is looking at. Today you cause both on purpose, safely.
Skills it develops
debuggingloops
How it is assessed
3 graded challenges inside the lab, and 7 questions at the end that check the idea rather than the clicks. Every attempt is saved, so a retry after a mistake counts as the learning it is.