So lets say I have this array :
array = [[1,2,3],[4,5,6],[7,8,9]]
and I want to get the index of the inner array containing the 5 for example. So in this case the returned index I want is 1.
I did try ind = array.index(5) but I'm quite aware why this didnt work since the value in the brackets have to match the element in the array exactly. Another way I did this is
counter = 0
for each in array:
if 5 in each: break
else: counter = counter + 1
and this worked well for what I want but I wanted to check if there is an easier and cleaner way to do this. Thanks