问题:
题目来源:力扣(LeetCode)
难度:简单
分析:
有数学方法和字符方法两种方法
解决方法:
1:数学方法
class Solution():
def reverse(self,x):
rList = []
minus = False
#判断正负,负数转正,并留flag
if x < 0:
minus = True
x = x * (-1)
while x // 10 != 0:
#不断取余,从末位存数
rList.