赋值变量
s = [1,2,3]
id(s)
2322194254912 (值不一定一样)
s *= 2
s
[1, 2, 3, 1, 2, 3]
id(s)
2322194254912
删除一个或者多个指定的对象
x = [0,1,2,3,4,5,6]
del x [1:4]
x
[0, 4, 5, 6]
x = [0,1,2,3,4,5,6]
del x [0:3]
x
[3, 4, 5, 6]
赋值变量
s = [1,2,3]
id(s)
2322194254912 (值不一定一样)
s *= 2
s
[1, 2, 3, 1, 2, 3]
id(s)
2322194254912
删除一个或者多个指定的对象
x = [0,1,2,3,4,5,6]
del x [1:4]
x
[0, 4, 5, 6]
x = [0,1,2,3,4,5,6]
del x [0:3]
x
[3, 4, 5, 6]