Advertisement
Rementai

Choinka Pyton

Mar 2nd, 2023
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. while True:
  2.     height = input("Please enter a height of the pyramid: ")
  3.  
  4.     height = int(height)
  5.     space = height - 1
  6.     symbol = 1
  7.  
  8.     for i in range(height):
  9.             print(" "*space, end="")
  10.             space -= 1
  11.             if height % 2 == 0:
  12.                 print("*"*symbol, end="")
  13.                 symbol += 2
  14.             else:
  15.                 print("#"*symbol, end="")
  16.                 symbol += 2
  17.             print()
  18.     if height == 7:
  19.         break
  20.  
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement