展开全部
#1.字符串、列表、元组均可用此方法 (使用切片的方法) 不修改元素原有内容,将输出进行赋值
#1.1 字符串
s='nihao'
s1=s[::-1]
#1.2 列表
lin=["a","b","c"]
print(lin[::-1])
#1.3 元组
tup=("e","f","g","h",2,3,6)
print(tup[::-1])
#2.列表独有方法
lin=["a","b","c"]
lin.reverse()
print(lin)