Advertisement
simeonshopov

Square Frame

Oct 17th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. n = int(input())
  2. #printing the top row
  3. print("+", end = " ")
  4. for i in range(n - 2):
  5.   print("-", end = " ")
  6. print("+")
  7. #printing the mid rows
  8. for row in range(n -2):
  9.   print("|", end = " ")
  10.   for col in range(n - 2):
  11.     print("-", end = " ")
  12.   print("|")
  13. #printing the bottom row
  14. print("+", end = " ")
  15. for i in range(n - 2):
  16.   print("-", end = " ")
  17. print("+")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement