So I have a for loop.
>>> row = [5, 2, 5, 4, 2, 2, 5, 5, 5, 2]
>>> for i in row:
if i == 5:
print(row.index(i))
if i == 2:
print(row.index(i))
OUTPUT
0
1
0
1
1
0
0
0
1
I want to get: 0 1 2 4 5 6 7 8 9.
In other words, I want to get the index of the i I'm currently looking at in the for loop, if it is = 5 or 2... any easy way to do this?