Advertisement
simeonshopov

Draw a Fort (book)

Nov 12th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. import math
  2. n = int(input())
  3.  
  4. col_size = math.trunc(n / 2)
  5. mid_size = n * 2 - 2 * col_size - 4
  6. roof = ("/{0}\\{1}/{0}\\".format("^" * col_size, "_" * mid_size))
  7. print(roof)
  8.  
  9. for i in range(n - 3):
  10.   print("|" + " " * (2 * n - 2) + "|")
  11. print("|" + " " * (col_size + 1) + "_" * mid_size + " " * (col_size + 1) + "|")
  12. bottom = ("\\{0}/{1}\\{0}/".format("_" * col_size, " " * mid_size))
  13. print(bottom)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement