字符串处理

Python 字符串反转

1
2
s = 'hello world'
s = s[::-1]

Python Rot13

1
2
3
import codecs
 
s = codecs.encode('Hello World', 'rot13'))