Advertisement
Spocoman

05. Square Frame

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