So I have a following list:
found = ['ITERATION 0', 'string', 'ITERATION 1', 'string', 'ITERATION 2', 'string']
I am trying, and I can't for the life of me find any answers from StackOverflow or Youtube, to extract the index of each ITERATION
.
So in my example the reslt would be [0, 2, 4]
.
I can use found.index(r'ITERATION 0')
to find the specific occurrence; but this doesn't help me find 2
and 4
.