题目描述:
把str反转
注意:
s[::-1]可以倒置字符串
class Solution(object):
def reverseString(self, s):
"""
:type s: str
:rtype: str
"""
return s[::-1]
if __name__=="__main__":
sol=Solution()
s="hello"
res=sol.reverseString(s)
print res