【发布时间】:2014-07-06 01:25:56
【问题描述】:
count = 1
for i in range(10):
for j in range(0, i):
print(count, end='')
count = count +1
print()
input()
我正在编写一个程序,它的输出应该是这样的。
1
22
333
4444
55555
666666
7777777
88888888
999999999
使用上面的代码,我已经非常接近了,但是我的计数工作方式只是逐字逐句递增。我只需要帮助让它只数到 9,但显示如上。谢谢。
【问题讨论】:
-
我来这里是为了确保缩进正确。
标签: python python-3.x nested-loops