fork download
  1. height = 18
  2.  
  3. # 打印树冠
  4. for i in range(height):
  5. print(' ' * (height - i - 1), end='')
  6. print('*' * (2 * i + 1))
  7.  
  8. # 打印树干
  9. trunk_h = 3
  10. for _ in range(trunk_h):
  11. print(' ' * (height - 2), end='')
  12. print('***')
  13.  
  14. print("\n🎄Merry Christmas!🎄")
  15.  
Success #stdin #stdout 0.07s 7912KB
stdin
Standard input is empty
stdout
                 *
                ***
               *****
              *******
             *********
            ***********
           *************
          ***************
         *****************
        *******************
       *********************
      ***********************
     *************************
    ***************************
   *****************************
  *******************************
 *********************************
***********************************
                ***
                ***
                ***

🎄Merry Christmas!🎄