倒转 相关的软件列表

Python 字符串中的字符倒转
Python

Python 字符串中的字符倒转

2020-04-08 标签:python,字符串,字符,倒转,方法,使用,s,print,reverse,l,list,join,输出,结果,n,ohtyp

方法一,使用[::-1]: s = 'python' print s[::-1] 方法二,使用reverse()方法: l = list(s) l.reverse() print ''.join(l) 输出结果: nohtyp nohtyp