遍历列表,并删除元素
print("-----------------------")
list2 = [1, 2, 3, 4, 5, 6, 55, 33, 66, 87]
for index, item in enumerate(list2[:]):
print(index,' ',item)
list2.remove(item)
print(list2)
print("-----------------------")
list3 = [1, 2, 3, 4, 5, 6, 55, 33, 66, 87]
list4 = list3.copy()
for i in list4:
list3.remove(i)
print(list3)