分为上下三角,两个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