Advertisement
Spocoman

Draw Fort

Oct 11th, 2023
686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. n = int(input())
  2.  
  3. x = n * 2 - int(n / 2 + 2) * 2 if n > 4 else 0
  4.  
  5. print(f"/{'^' * int(n / 2)}\\{'_' * x}/{'^' * int(n / 2)}\\")
  6.  
  7. for i in range(n - 3):
  8.     print(f"|{' ' * (n * 2 - 2)}|")
  9.  
  10. print(f"|{' ' * int((n * 2 - (x + 2)) / 2)}{'_' * x}{' ' * int((n * 2 - (x + 2)) / 2)}|")
  11.  
  12. print(f"\\{'_' * int(n / 2)}/{' ' * x}\\{'_' * int(n / 2)}/")
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement