0
Is this an infinity loop?
I was trying to create a python code of an infinity loop with the for loop. Is this an infinity loop? It simply says no output here. https://code.sololearn.com/cptLLQBqzlDi/?ref=app
5 Answers
+ 3
No, this is not an endless loop.
Since you set the cycle step to negative, it does not fall in the range from 1 to 10, so the cycle will not be performed.
+ 2
Hi! Your program is not worked.
+ 1
to make an infinite loop with "while" is done like this:
while True:
//Your code
0
Absolutely.
Tell me, why do you need an infinite loop and why do you want to do it with the help of "for", because with the help of "while" it is much easier?