class Solution: def solve(self , str ): tempList=list(str) #字符串转为列表 tempList.reverse() return ''.join(tempList)