# 革除列表中的所有元素
>>> lst = [1, 2, 3, 4, 5]
>>> del lst[:]
>>> lst
[]
# 能够在不创立新列表对象的状况下替换列表的所有元素:>>> a = lst
>>> lst[:] = [7, 8, 9]
>>> lst
[7, 8, 9]
>>> a
[7, 8, 9]
>>> a is lst
True
# 还能够创立列表的(浅)正本:>>> b = lst[:]
>>> b
[7, 8, 9]
>>> b is lst
False
# 革除列表中的所有元素
>>> lst = [1, 2, 3, 4, 5]
>>> del lst[:]
>>> lst
[]
# 能够在不创立新列表对象的状况下替换列表的所有元素:>>> a = lst
>>> lst[:] = [7, 8, 9]
>>> lst
[7, 8, 9]
>>> a
[7, 8, 9]
>>> a is lst
True
# 还能够创立列表的(浅)正本:>>> b = lst[:]
>>> b
[7, 8, 9]
>>> b is lst
False