题解 | #菱形图案#
菱形图案
https://www.nowcoder.com/practice/8b935f8ffe99445dbd42494febd13e45
分为上下三角,两个for来输出
while True: try: n = int(input()) for i in range(1,n+2): print(' '*(n+1-i)+'* '*i) for j in range(1,n+1): print(' '*(j)+'* '*(n+1-j)) except: break