📜  python代码示例中的倒梯形图案

📅  最后修改于: 2022-03-11 14:45:51.816000             🧑  作者: Mango

代码示例1
n=int(input())
l=[];c=1
for i in range(n,0,-1):
    temp=[j for j in range(c,c+i)]
    l.append(temp)
    c+=i
l=l[::-1]
for i in range(1,n+1):
    temp=['-' for j in range(n-i)]
    temp+=l[i-1]
    temp+=[j for j in range(c,c+i)]
    print(*temp)
    c+=i# Published By PKJCODERS