When iterating over a list and removing each item, why is every other item skipped and not removed? (I realise it may be bad practise to do this I just want to understand what is going on)
lst=[0,1,2,3,4,5,6,7,8,9]
for item in lst:
lst.remove(item)
print(lst)
Expected output: []
Actual output: [1, 3, 5, 7, 9]