For lists the method list.index(x) returns the index in the list of the first item whose value is x. But if I want to look inside the items, and not just at the whole items, how do I make the slickest Python method for this?
For example, with
l = ['the cat ate the mouse','the tiger ate the chicken','the horse ate the straw']
this function would return 1
provided with the argument tiger
.