#菱形的打印
layer = int(input("请输入需要打印的层数:"))
for x in range(1, layer + 1):
#先打印空格
space_num = layer - x
for y in range(0, space_num):
print(" ", end="")
#在打印*
star_num = 2*x - 1
for y in range(0, star_num):
print("*", end="")
#换行
print("")
for x in range(layer - 1, 0, -1):
#先打印空格
space_num = layer - x
for y in range(0, space_num):
print(" ", end="")
#在打印*
star_num = 2*x - 1
for y in range(0, star_num):
print("*", end="")
#换行
print("")