📜  在 python 代码示例中绘制领结

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

代码示例1
num = int(input("Enter an odd number greater than 4: "))
center = (num - 1)//2
for row in range(num):
    nspaces = 2*abs(row - center)
    nstars = num - nspaces
    print nstars*'*' + 2*nspaces*' ' + nstars*'*'