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
5If you want to loop until a specified number, use range(number)
for i in range(6): print(i)
0
1
2
3
4
5Last updated
Was this helpful?