https://www.cnblogs.com/songqingbo/p/5126957.html
切片操作
s=‘asdfggg’
print(s[1:3])
>>>>>>
sd
反转字符串
# ----反转字符串 # 第一种:使用字符串切片 # result = s[::-1] # 第二种:使用列表的reverse方法 # l = list(s) # l.reverse() # result = "".join(l)
https://www.cnblogs.com/songqingbo/p/5126957.html
切片操作
s=‘asdfggg’
print(s[1:3])
>>>>>>
sd
反转字符串
# ----反转字符串 # 第一种:使用字符串切片 # result = s[::-1] # 第二种:使用列表的reverse方法 # l = list(s) # l.reverse() # result = "".join(l)