I have a matrix of the form,
mymatrix=[[1,2,3],[4,5,6],[7,8,9]]
I want to the get the index of, say for example, 9 which is at (2,2).
if you want to find the index of all the occurrence of a val or character in a 2d list, this code may help you and it's readable. Tnq.
for i, e in enumerate(board): for j, ee in enumerate(e): if 'd' in ee: print(i, j)
you can find multiple occurrences too.