l=[1,2,10,30,33,99,101,200,301,311,402,403,500,900,1000] print(l[::]) print(l[::-1]) print(l[0:5:1]) 正向,顾头不顾尾,步长1 print(l[5::-1]) 反向,。。。步长-1 print(l[5:]) 5开始直到结束 print(l[:5]) 0开始到5结束,
[1, 2, 10, 30, 33, 99, 101, 200, 301, 311, 402, 403, 500, 900, 1000]
[1000, 900, 500, 403, 402, 311, 301, 200, 101, 99, 33, 30, 10, 2, 1] #反向输出
[1, 2, 10, 30, 33]
[99, 33, 30, 10, 2, 1]
[99, 101, 200, 301, 311, 402, 403, 500, 900, 1000]
[1, 2, 10, 30, 33]
l=[1,2,3] l=l[3:] 超出范围,变空列表 print(l)
[]