+ 2

Why do I get an infinite loop

i = 1 while i <=5 print(i) i = i + 1

14th Jul 2020, 10:23 AM
🔥 Destiny Travolta 🔥
3 Antworten
+ 2
The code won't run because of improper indentation ,not sure how you get infinite loop i = 1 while i <=5: print(i) i = i + 1
14th Jul 2020, 10:28 AM
Abhay
Abhay - avatar
+ 1
Thanks so much guys
14th Jul 2020, 10:29 AM
🔥 Destiny Travolta 🔥
+ 1
Indentation error will occur due to not following spaces as per syntax but your code seems to be correct.
15th Jul 2020, 3:12 PM
shubham kumar
shubham kumar - avatar