Module 4
Repetition
for, range, while, break
When you finish this module you can say:
I can repeat work with a loop and accumulate results.
By the end of this module you'll be able to write a number-guessing game that keeps asking until you get it, and counts your tries.
StartLessons
7 lessons · ≈ 65 min
- for and range9 min
- Looping over text8 min
- Accumulating: totals and counters10 min
- while: until the condition ends9 min
- break and continue8 min
- A function can't change the outside9 min
- Project: Number-guessing game12 min · project
Practice exercises
Short writing exercises, independent of the lessons: Go to the exercises