import numpy field numpy zeros def handling_bomb m1 m2 for in range fi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import numpy
n = 5
field = numpy.zeros((n, n))
def handling_bomb (m1, m2):
for i in range(n):
field[m1][i] += 1
if m1 != i:
field[i][m2] += 1
handling_bomb(2,3)
handling_bomb(0,2)
handling_bomb(1,4)
handling_bomb(2,0)
print(f'{field}')