I used to thought that for-loop in python work like this
it first makes an iterator by doing iter(iterable)
then does next(that_new_iterator_object)
and when it raises StopIteration
then for-loop ends and goes to else
block (if provided)
but here it is working differently
>>> a = [1,2,3,4,5,6,7,8,9]
>>> for i in a:
del a[-1]
print(i)
1
2
3
4
5
where are the other numbers 6,7,8,9 the new iterator object that for-loop creates and variable a is different