python学习----字符分片索引

\\print("hello world")

s1="hello world"
print("s1[0:1]")
**he
print("s1[:]")
**hello world
print("s1[7:]")
**world
print("s1[::2]")
**hlowrd

猜你喜欢

转载自blog.csdn.net/printfsome/article/details/81077315