使用循环打印出下列图形011222333344444555556666777889用Python语言描述上述
图形的代码如下:
for i in range(10):
if i <= 4:
print(str(i) * (i+1))
else:
print(str(i) * (10-i))
输出结果为:
0
11
222
3333
44444
55555
6666
777
88
9
原文地址: https://www.cveoy.top/t/topic/eZxH 著作权归作者所有。请勿转载和采集!