打印行数用键盘输入
使用for-for循环语句
border_num=int(input('请输入要打印的层数n:'))
for i in range(1,border_num+1):
for j in range(border_num-i):
print(' ',end=' ')
for k in range(1,i+1):
print(k,end=' ')
for r in range(i-1,0,-1):
print(r,end=' ')
print()