标签:div bsp class 图形 nbsp 倒序 print range 利用
实现如下图形:左正序三角
1 2 3 4 5 6 7 8 9
2 3 4 5 6 7 8 9
3 4 5 6 7 8 9
4 5 6 7 8 9
5 6 7 8 9
6 7 8 9
7 8 9
8 9
9
for i in range(0,10): for j in range(1,10-i): print(i+j,end=" ") print(end="\n")
右倒序三角
9 8 7 6 5 4 3 2 1
8 7 6 5 4 3 2 1
7 6 5 4 3 2 1
6 5 4 3 2 1
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1
for i in range(0,10): print(i*" ",end=" ") for j in range(9-i,0,-1): print(j,end=" ") print(end="\n")
标签:div bsp class 图形 nbsp 倒序 print range 利用
原文地址:https://www.cnblogs.com/hrv5/p/11973514.html