New course! Every coder should learn Generative AI!
Try a free lesson0
Infinite for in python3
is there a way to make an infinite for loop?
3 Answers
+ 8
Try this:
for i in iter(int, -1):
pass
+ 1
Why? It’s better to use a while loop such as while true:
- 1
I don’t think it’s possible in python