Skip to content

Chapter 7: Loops

Loops allow you to repeat a block of code multiple times.

While Loop Example

Python
1
2
3
4
count = 0
while count < 5:
    print(count)
    count += 1

This while loop prints numbers from 0 to 4.