#python3 一定要加,end=” “,好恶心
n=int(input('请输入行数'))
#i=j=k=1
for i in range(n):
for j in range(n-i):
print(" ",end=" ")#输出语句附加的字符串
j=j+1
for k in range(2*i-1):#这里i最多等于3,打印前3行
print("*",end=" ")
k=k+1
print("\n")
i=i+1
for i in range(n):
for j in range(i):
print(" ",end=" ")
j=j+1
for k in range(2*(n-i)-1):#i=4,从第四行开始打印
print("*",end=" ")
k=k+1
print("\n")
i=i+1