Hi,
matrix build by this code:
I want to save (0,0) (0,2) (1,1) (1,2) (2,0), position of non zero elements, for example like this:
Code:
1 0 -1
0 1 4
3 0 0
matrix build by this code:
Code:
n = int(input()) # n=3
for i in range(n):
a =[]
for j in range(n):
a.append(int(input()))
adjacency_matrix.append(a)
I want to save (0,0) (0,2) (1,1) (1,2) (2,0), position of non zero elements, for example like this:
Code:
x =[
0 0
0 2
1 1
1 2
2 0]