题解 | #数字颠倒#
数字颠倒
https://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe
import sys
try:
num = int(input(''))
except Exception:
print('输入类型错误')
else:
if num >=0:
numStr = str(num)
print(numStr[::-1])
else:
print('请输入正整数')
数字颠倒
https://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe
import sys
try:
num = int(input(''))
except Exception:
print('输入类型错误')
else:
if num >=0:
numStr = str(num)
print(numStr[::-1])
else:
print('请输入正整数')
相关推荐