Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 4
- a = [[1, 0, 0, 0],
- [1, 1, 0, 1],
- [1, 1, 1, 1],
- [1, 0, 1, 1]]
- for i in range(1, n):
- for j in range(1, n):
- if a[i - 1][j - 1] == a[i - 1][j] == a[i][j - 1] == a[i][j] == 0:
- print('квадрат с нулями')
- if a[i - 1][j - 1] == a[i - 1][j] == a[i][j - 1] == a[i][j] == 1:
- print('квадрат с единицами')
Advertisement
Add Comment
Please, Sign In to add comment