固定行数遍历输出字符
def tri_pyramid(char):
for i in range(1,6):
print(" "*(5-i),end="")
print((char+" ")*i,end="")
print()
char=input()
tri_pyramid(char)
固定行数遍历输出字符
def tri_pyramid(char):
for i in range(1,6):
print(" "*(5-i),end="")
print((char+" ")*i,end="")
print()
char=input()
tri_pyramid(char)