网站首页
高清电影
无损音乐
游戏攻略
电脑教程
破解资源
站长资源
软件下载
Python 字符串中的字符倒转
(编辑:jimmy 日期: 2024/10/4 浏览:
2
)
方法一,使用[::-1]:
s = 'python'
print s[::-1]
方法二,使用reverse()方法:
l = list(s)
l.reverse()
print ''.join(l)
输出结果:
nohtyp
nohtyp
上一篇:
rhythmbox中文名乱码问题解决方法
下一篇:
Python备份Mysql脚本
首页
音乐
电影
资源