【发布时间】:2022-10-24 13:35:49
【问题描述】:
我想写程序
当我输入 12 的数字时
该程序将打印数字,即'9'之后是'0'。
例如:
输入数字:12
输出
0
1
2
3
4
5
6
7
8
9
0
1
x = input("Enter the number: ")
x = int(x)
for i in range (x):
print(str(i))
任何人都可以给我一个想法?谢谢
【问题讨论】:
-
您会发现modulo operator (%) 很有用
标签: python-3.x