Find matching index
Finds the index of the first element in the given list that satisfies the provided testing function.
- Use a list comprehension,
enumerate()
andnext()
to return the index of the first element inlst
for whichfn
returnsTrue
.
Finds the index of the first element in the given list that satisfies the provided testing function.
enumerate()
and next()
to return the index of the first element in lst
for which fn
returns True
.