python 字符串翻转

原文链接: https://www.runoob.com/python3/python-string-reverse.html

字符串反转:

方法一:使用字符串切片

tmp=str[::-1]

方法二:使用reversed()

tmp=''.join(reversed(str))

猜你喜欢

转载自blog.csdn.net/lyc0424/article/details/102621030