题解 | #字符串反转#
字符串反转
http://www.nowcoder.com/practice/e45e078701ab4e4cb49393ae30f1bb04
An ordinary Python solution.
Note that ''.join() is a good way to turn Python list into string.
nums = input() i = len(nums) - 1 tmp = [] while i >= 0: tmp.append(nums[i]) i -= 1 ans = ''.join(tmp) print(ans)