Infinite for loops possible in Python?
Is it possible to get an infinite loop in for loop? My guess is that there can be an infinite for loop in Python. I’d like to know this for future references.
Is it possible to get an infinite loop in for loop? My guess is that there can be an infinite for loop in Python. I’d like to know this for future references.
In Python, you can do: In Python 3.5, you can do: And then: Will always be true. Unless of course, as pointed out, x is also infinity or “nan” (“not a number”). Additionally (Python 2.x ONLY), in a comparison to Ellipsis, float(inf) is lesser, e.g: would return true.