For loop basic
Python allows you loop over a list
for i in [0,1,2,3,4,5]: print(i)
0
1
2
3
4
5
If you want to loop until a specified number, use range(number)
for i in range(6): print(i)
0
1
2
3
4
5
Last updated
Was this helpful?