6. Looping

For Loops vs. While Loops

The third construct of programming (after Sequence and Selection) is Iteration! If you iterate something then you repeat it. if you iterate something then you repeat it.

There are two key loops to use in Python: ‘for’ loops and ‘while’ loops.

A for loop is count controlled – e.g. “For 10 seconds I will jump up and down”.
The loop will continue until the range has finished.

A while loop is condition controlled – e.g. “While I am not out of breath I will jump up and down.”
The loop will continue until the condition is no longer true.


Click the links below for information on Python’s two types of loop:

For Loops [Count-Controlled Loops]

While Loops [Condition-Controlled Loops]


When you have read the pages above and tried the practice task(s) on each page then attempt these:

End of Section Practice Tasks