直接上,冲冲冲
#方法1:对切片的掌握:[::-1],取反
# while True:
# num = input("请输入一个不能超过十位数的整数:")
# num = num[::-1]
# num = int(num)
# print(num)
方法2:
n = int(input('请输入一个数字'))
b = 0
while n:
a = n%10
n = n//10
b = b*10 + a
print(b)
直接上,冲冲冲
#方法1:对切片的掌握:[::-1],取反
# while True:
# num = input("请输入一个不能超过十位数的整数:")
# num = num[::-1]
# num = int(num)
# print(num)
方法2:
n = int(input('请输入一个数字'))
b = 0
while n:
a = n%10
n = n//10
b = b*10 + a
print(b)