序列【起始:结束:步长】
list = [0, 1, 2, 3, 4, 5, 6, 7]
a = list[1:4]
print(a)
print(list[3:1:-1])
tu2 = (0, 1, 2, 3, 4, 5, 6, 7, 8)
print(tu2[:])
print(tu2[::-2])
mystr = "hello pjb study python"
print(mystr[::2])
print(mystr[::-1])
序列【起始:结束:步长】
list = [0, 1, 2, 3, 4, 5, 6, 7]
a = list[1:4]
print(a)
print(list[3:1:-1])
tu2 = (0, 1, 2, 3, 4, 5, 6, 7, 8)
print(tu2[:])
print(tu2[::-2])
mystr = "hello pjb study python"
print(mystr[::2])
print(mystr[::-1])