PyAI Learn Türkçe

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.

Start

Lessons

7 lessons · ≈ 65 min

  1. for and range9 min
  2. Looping over text8 min
  3. Accumulating: totals and counters10 min
  4. while: until the condition ends9 min
  5. break and continue8 min
  6. A function can't change the outside9 min
  7. Project: Number-guessing game12 min · project

Practice exercises

Short writing exercises, independent of the lessons: Go to the exercises

  1. Counting by fives
  2. Total and even count
  3. Double letters
  4. Add until zero