# * # * * # * * * # * * * * # * * * * * x = 0 while x < 5: x += 1 # 每次循环需要给y赋值0.清空y中存储的值 y = 0 while y < x: print('*', end='') y += 1 print('') # * # * * # * * * # * * * * # * * * * * # * * * * # * * * # * * # * row = 0 while row < 5: row += 1 col = 0 while col < row: col += 1 print('*', end='') print('') while 5<= row < 9: row += 1 col = 9 while col >= row: col -= 1 print('*', end='') print('')