Python学习之路,点击有全套Python笔记 1、字符串索引 name = '123456' print(name[0]) print(name[1]) print(name[2]) 2、字符串切片序列[开始位置下标:结束位置下标:步⻓] [,) name = "abcdefg" print(name[2:5:1]) # cde print(name[2:5]) # cde print(name[:5]) # abcde print(name[1:]) # bcdefg print(name[:]) # abcdefg print(name[::2]) # aceg print(na