Advertisement
Spocoman

09. House

Jan 2nd, 2022
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. num = int(input())
  2. for row in range(1, int((num + 1) / 2)):
  3.     if row != int((num + 1) / 2):
  4.         if num % 2 == 0:
  5.             output = int(num / 2 - row) * '-' + (row * 2) * '*' + int(num / 2 - row) * '-'
  6.         else:
  7.             output = int(num / 2 - row + 1) * '-' + (row * 2 - 1) * '*' + int(num / 2 - row + 1) * '-'
  8.     print(output)
  9. print(num * '*')
  10. for i in range(1, int((num + 2) / 2)):
  11.     output = ''
  12.     for j in range(num):
  13.         if j == 0 or j == num - 1:
  14.             output += '|'
  15.         else:
  16.             output += '*'
  17.     print(output)
  18.  
  19.  
  20.  
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement