remove 是根据元素来删除的:
>>> a = [0, 2, 2, 3]
>>> a.remove(2)
>>> a
[0, 2, 3]
del是根据索引来删除的:
>>> a = [3, 2, 2, 1]
>>> del a[1]
>>>a
[3, 2, 1]
del还可以删除指定范围内的值:
a = [3,2,2,1]
>>>del a[1,3]
>>>a
[3]
del还可以删除整个列表:
>>>del a
pop()会弹出列表末尾的元素:
>>> a = [4, 3, 5]
>>> a.pop()
5
>>> a
[4, 3]
要删除指定位置的元素,用pop(i)方法,其中i是索引位置:
>>>a=[4,3,5]
>>>a.pop(1)
3
>>>a
[4,5]