Python字符串反转

从这里看到的Python小技巧, 利用切片将字符串反转

>>> a = "I love oschina!"

>>> b = a[::-1]

>>> print b

'!anihcso evol I'

你可能感兴趣的:(python技巧)