+ 1
Infinite loop
is this the correct way to go on a infinite loop c = 0 while True: print(c) c+=2 if c > 500: break
2 Antworten
+ 10
No because your code will break the loop once the value of c is more than 500
remove the break statement to make it an infinite loop
# a general infinite loop
while True:
# statements
Note: You can even use the number 1 instead of True
+ 1
Oh, i thought the 0(False) and 1(True) just based examples didn't thought they could actually be used in actual code