Advertisement
pacho_the_python

Untitled

Nov 7th, 2021
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. from math import ceil, floor
  2. n = int(input())
  3.  
  4. length = n
  5. dash = n - 1
  6. stars_base = n - 2
  7. high_roof = ceil(n / 2)
  8. high_base = floor(n / 2)
  9. stars_roof = 1
  10. if n % 2 == 0:
  11.     stars_roof += 1
  12.     dash = n - 2
  13. for x in range(1, high_roof + 1):
  14.     dash_left_right = dash // 2
  15.     print("-" * dash_left_right + "*" * stars_roof + "-" * dash_left_right)
  16.     dash -= 2
  17.     stars_roof += 2
  18.  
  19. for y in range(1, high_base + 1):
  20.     print("|" + "*" * stars_base + "|")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement