def kzkz(ceng):
for i in range(1,ceng+1):
print(" "*(ceng-i),end='')
n=i
while(n>=1):
print(n,end='')
n-=1
n+=2
while(n<=i):
print(n,end='')
n+=1
print()
kzkz(5)
1
212
32123
4321234
543212345
标签:end,自定义,kzkz,while,print,金字塔,ceng,Python3
来源: https://www.cnblogs.com/kzkzkz/p/10344184.html