例1
收入123
输出321
例2
输入-123
输出-321
例3
输入120
输出21
答案
思路,
1、先考虑末尾是0的情况时,翻转后需要把0去掉,
2、当有-号时,把翻转后末尾的-号去掉,再在前面加一个-号
3、正数时不变

a= -56435
tmp = str(a)[::-1]
print(tmp[0])
while True:
if tmp[0] == '0':
tmp = tmp[1::]
continue
else:
break
if str(a)[0] == '-':
c = '-'+ tmp
b = c[:-1]
print(b)
else:
b= tmp
print(b)





![[附源码]Python计算机毕业设计SSM京东仓库管理系统(程序+LW)](https://img-blog.csdnimg.cn/aa49a5f11b6948019058efb0e08a8fa4.png)
![[附源码]计算机毕业设计项目管理系统的专家评审模块Springboot程序](https://img-blog.csdnimg.cn/d266f6148348495b993f0af70e5ee15b.png)









![[附源码]计算机毕业设计基于JEE平台springboot技术的订餐系统](https://img-blog.csdnimg.cn/166403baafb045a7aedace45343646e1.png)

