Python语言技术文档

微信小程序技术文档

php语言技术文档

jsp语言技术文档

asp语言技术文档

C#/.NET语言技术文档

html5/css技术文档

javascript

点击排行

您现在的位置:首页 > 技术文档 > Python编程技巧

Python 字符串中的字符倒转

来源:中文源码网    浏览:172 次    日期:2024-05-11 19:22:08
【下载文档:  Python 字符串中的字符倒转.txt 】


Python 字符串中的字符倒转
方法一,使用[::-1]: s = 'python' print s[::-1] 方法二,使用reverse()方法: l = list(s) l.reverse() print ''.join(l) 输出结果: nohtyp nohtyp

相关内容