1.列表切片 l=['a','b','c','d','e','f'] print(l[1:5]) # 根据索引号来切片,但顾头不顾尾 ['b', 'c', 'd', 'e'] print(l[1:5:2]) # 根据索引号来切片,顾头不顾尾,后面加个haxi值每两个空一个 ['b', 'd'] print(l[2:5] ) ['c', 'd', 'e'] print(l[-1]) #-1代表从后往前取 -1代表最后一个 f l=['a','b','c','d','e','f'] print(l[…