return list indices if two conditions met in python
<p>I'm trying to find the indices in a list if two conditions are met, and store those indices in a new list. At the moment I can find the entries on the list that meet the condition, but cannot figure out how to get the list indices.</p>

<p>The list is:</p>

<pre><code>[[0, 1], [1, 0], [0, 2], [1, 1], [2, 0], [0, 3], [1, 2], [2, 1], [3, 0]]
</code></pre>

<p>My code so far:</p>

<pre><code>m2=[]
for i in range(0,len(gmcounter)):
  if countersum[i]==2 and 2 in gmcounter[i]:
    m2.append(gmcounter[i])
print m2
</code></pre>

<p>Countersum is a list containing the sums of the list elements, so this returns <code>[[0, 2], [2, 0]]
</code>
And I would like m2 to take the index values where the two conditions are met, so I would like it to m1 to take <code>[4,5]</code></p>

<p>I have an idea it will be something to do with the enumerate function but my attempts to include that so far have not worked</p>

<p>Would greatly appreciate any help!!</p>
