python的字符串基本操作
str = 'changsha' print(str) print(str[0]) print(str[0:5]) print(str[0:8:2]) print(str[:5]) print(str[5:]) print(str + ",你好") print(str * 3)
print("hello\tworld") print(r"hello\tworld")
str = 'changsha' print(str) print(str[0]) print(str[0:5]) print(str[0:8:2]) print(str[:5]) print(str[5:]) print(str + ",你好") print(str * 3)
print("hello\tworld") print(r"hello\tworld")