num = "0123456789"

"""截取2-5位置的字符串
       2-末尾
       开始-5位置
       完整
    从开始位置，每隔一个字符取字符串
    从索引1开始，每隔一个取
       2-(末尾-1)
       末尾两个
       逆序"""
print(num[2:6]) # 2345
print(num[2:])  # 23456789
print(num[0:6]) # 012345
print(num[:6])  # 012345
print(num[:])   # 0123456789
print(num[::2]) # 02468
print(num[1::2])    # 13579
print(num[-1])  # 9
print(num[2:-1])    # 2345678
print(num[0::-1])   # 0
print(num[-1::-1])  # 9876543210
