def reverse(): number = eval(input("请输入一个整数")) a = number // 10000 b = (number % 10000) // 1000 c = (number % 1000) // 100 d = (number % 100) // 10 f = number % 10 reverse_num = str(f) + str(d) + str(c) + str(b) +str(a) return reverse_num print(reverse())
标签:10,10000,reverse,number,整数,num,反向,str,定义 From: https://www.cnblogs.com/shirleysu90/p/17102529.html