There are two types of loops in python for loops and while loops. Here is a brief explanation of both and then an example. For the for loop the range command allow you to determine how long the loop will last or iterate through several values, start is where the value will begin, end is where it will end not including that value and step is how much it increments by.
while x is true:
do this thing
for i in range(start, end, step):
do this thing
Examples:
code:
x = 0
while x < 10:
print(x)
x += 1
Result:
0
1
2
3
4
5
6
7
8
9
code:
for x in range(1,11,2):
print(x)
Result:
1
3
5
7
9