In my Python 2.7.2 IDLE interpreter:
>>> mylist = [1, 2, 3, 4, 5] >>> for item in mylist: mylist.remove(item) >>> mylist [2,
Use a deep copy of mylist
mylist
mylist = [1, 2, 3, 4, 5] l = [k for k in mylist] # deep copy for i in range(len(mylist)): mylist.remove(l[i]) print print mylist