赞
踩
运行结果截图:
代码实现如下:
- lis = []
-
-
- for n in range(100, 1000):
- three_digit_number_list = list(str(n))
- num = (str(three_digit_number_list[1]) + str(three_digit_number_list[2]) + str(three_digit_number_list[0]))
- newnum = int(num)
- if newnum - n == 432:
- lis.append(str(n))
-
- orinums = " " .join(lis)
- print('学号:*** 姓名:***')
- print('原三位数为:{}'.format(orinums))
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。