Home › Learning paths › Loops

🔁 Loops — learning path

🔁 Beginner16 problemsFree · no login needed

What this path teaches

range() bounds, off-by-one errors, infinite while loops, break vs continue, and the loop variable that outlives its loop. Loops are where most beginner bugs concentrate — this path drills every classic shape.

By the end: You can state a loop's first value, last value, and iteration count before running it.

Your progress

0 of 16 opened

Start the path →

The problems, in order

  1. 1Print Numbers from 1 to 5
    🐛 Fix the bug · easy
  2. 2Print Even Numbers
    🐛 Fix the bug · easy
  3. 3Countdown
    🐛 Fix the bug · easy
  4. 4range() with wrong bounds
    🐛 Fix the bug · easy
  5. 5Off-by-one loop error
    🐛 Fix the bug · easy
  6. 6Looping one step too far
    🐛 Fix the bug · easy
  7. 7Off-by-one when counting down
    🐛 Fix the bug · easy
  8. 8Looping over a number instead of a sequence
    🐛 Fix the bug · easy
  9. 9Infinite while loop — forgot to update the counter
    🐛 Fix the bug · medium
  10. 10break vs continue
    🔮 Predict the output · medium
  11. 11break inside the wrong loop
    🐛 Fix the bug · medium
  12. 12for loop with range and step
    🔮 Predict the output · medium
  13. 13enumerate with a start value
    🔮 Predict the output · easy
  14. 14Loop variable after the loop ends
    🔮 Predict the output · medium
  15. 15else clause on a for loop
    🔮 Predict the output · medium
  16. 16Nested loop with a shared variable
    🔮 Predict the output · medium

How to work a path

Do the problems in order — each one assumes the rule taught by the one before it. Open a problem, try it in the interactive editor, and only then read the explanation. Progress is saved in this browser automatically (signed-in solves also earn XP and streaks). One path per week is a solid pace; finishing in a single sitting is allowed but not required.