xxxxxxxxxx
in python and most other languages, you would use a for loop
Here is an example
for i in range(5):
print(i)
The above prints 0 to 4.
Note it ends before 5 and not 5, because zero indexing.
The range function has a few other optional arguements
range(start,stop,step)
start means what number to start on (default 0)
range(1,5) = 1 2 3 4
stop is what number to stop on.
step is how much to increase each time. (default 1)
range(1,5,2) = 1 3