I want to find the index of the n\'th occurrence of an item in a list. e.g.,
x=[False,True,True,False,True,False,True,False,False,False,True,False,True] >
I can't say for certain that this is the fastest way, but I imagine it'd be pretty good:
i = -1 for j in xrange(n): i = x.index(True, i + 1)
The answer is i.
i