I am trying to clear a python list by removing every element in loop by code
x=list(range(10000))
for i in x:
x.remove(i)
I thought that after this code x must be [], but instead only every second element of list is removed. len(x)=5000 instead of 0.
Why is it so? What am I doing wrong. Thanks