- 2
How to do a loop easily in python?
I want examples
3 Answers
+ 6
#here is a loop that counts until it reaches a number
a=0
while a != 42:
a+=1
print(a)
#and if you want a infinite loop:
while True:
print("hoi")
+ 2
for i in range(10):
print(i)
+ 1
thanks