Advertisement
Guest User

House (book)

a guest
Nov 12th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import math
  2. n = int(input())
  3. stars = 1
  4. if n % 2 == 0:
  5.   stars += 1
  6. roof_lenght = math.ceil(n / 2)
  7. for i in range(roof_lenght):
  8.   padding = (n - stars) // 2
  9.   line = "-" * padding + "*" * stars + "-" * padding
  10.   print(line)
  11.   stars += 2
  12. for i in range(n // 2):
  13.   line = "|" + "*" * (n - 2) + "|"
  14.   print(line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement