moshkit

matrix_quarters

Apr 18th, 2020
609
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. N = int(input())
  2.  
  3. matrix = [[((i < j and (i < N - 1 - j))) * 1 + ((i < j and (i > N - 1 - j))) * 2 + ((i > j and (i < N - 1 - j))) * 4 +
  4.            ((i > j and (i > N - 1 - j))) * 3 for j in range(N)] for i in range(N)]
  5.  
  6. for i in range(N):
  7.     print(matrix[i])
Advertisement
Add Comment
Please, Sign In to add comment