Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def central():
- height_of_the_tower = get_height_of_the_tower()
- printer(height_of_the_tower, height_of_the_tower)
- def printer(height_of_the_tower, height):
- if height_of_the_tower == 0:
- return
- printer(height_of_the_tower - 1, height)
- print(" " * (height - height_of_the_tower), end='')
- print("#" * height_of_the_tower, end='')
- print(" ", end='')
- print("#" * height_of_the_tower)
- def get_height_of_the_tower():
- while True:
- try:
- height_of_the_tower = int(input("height_of_the_tower: "))
- if (height_of_the_tower > 0 and height_of_the_tower < 9):
- break
- except ValueError:
- None
- return height_of_the_tower
- central()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement