获取list或tuple的部分元素: L = ['Michael', 'Sarah', 'Tracy', 'Bob', 'Jack'] L[0:3] ['Michael', 'Sarah', 'Tracy'] L[:3] ['Michael', 'Sarah', 'Tracy'] L[-2:] ['Bob', 'Jack'] L[-2:-1] ['Bob'] L = list(range(100)) L [0,1,2,3,4,5,...,99] L[:10:2] [0,2,4,6,8] L[::…