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 refe
n = 0
li = [0]
for i in li:
n += 1
li.append(n)
print(li)
In the above code, we iterate over the list (li).
This will keep on going as in each iteration the size of list is increasing.