Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while True:
- height = input("Please enter a height of the pyramid: ")
- height = int(height)
- space = height - 1
- symbol = 1
- for i in range(height):
- print(" "*space, end="")
- space -= 1
- if height % 2 == 0:
- print("*"*symbol, end="")
- symbol += 2
- else:
- print("#"*symbol, end="")
- symbol += 2
- print()
- if height == 7:
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement