多样三角形
j=5 while j>=1: x = 0 while x <= 5-j : print(" ", end="") x+= 1 i = 1 while i<= 2 * j - 1: print("*", end="") i += 1 print() j-=1 #结果 # ********* # ******* # ***** # *** # * # j=5 # while j>=1: # x = 0 # while x <=10-2*j : # print(" ", end="") # x+= 1 # i = 1 # while i<= 2*j-1: # print("*", end="") # i += 1 # print() # j-=1 # #运行结果 # """ # ********* # ******* # ***** # *** # * # """