📜  python代码示例中的菱形图案

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

代码示例2
num = 9

for i in range(1, num+1):
  i = i - (num//2 +1)
  if i < 0:
    i = -i
  print(" " * i + "*" * (num - i*2) + " "*i)