python切片
双冒号
语法是seq[start:end:step]
例子
data=list(range(20))
print(data[1:18:2])
"""
[1, 3, 5, 7, 9, 11, 13, 15, 17]
"""
data=[1,2,3,4,5,6,7,8,9]
print(data[::-1])
"""
[9, 8, 7, 6, 5, 4, 3, 2, 1]
"""
data=[1,2,3,4,5,6,7,8,9]
print(data[::-1][:3])
"""
[9, 8, 7]
"""
也就是说先将list倒序再切片