lst = [1,2,3,4,5]
def rem_items(lst):
for i in lst:
print(lst)
time.sleep(1)
lst.remove(i)
rem_items(lst)
returns
[1, 2, 3, 4, 5]
[2, 3, 4, 5]
[2, 4, 5]
I can understand the first two lines, but why does it remove 3 instead of 2?
And why is it stopping after removing 3, not 2,4,5?
Thanks in advance