We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Loading...
- Practice
- Python
- Introduction
- Loops
- Tutorial
Loops
Loops
Loops are control structures that iterate over a range to perform a certain task.
There are two kinds of loops in Python.
A for loop:
for i in range(0, 5):
print i
And a while loop:
i = 0
while i < 5:
print i
i += 1
Note Be careful about indentation in Python. Read more
Here, the term range(0,5)
returns a list of integers from to : .