#實心倒三角形 def inverted_triangle(n): for i in range(n,0,-1): print(' '*(n-i)+'*'*(2*i-1)) inverted_triangle(5) # ********* # ******* # ***** # *** # *