python search list of lists for value return index code example
Example 1: python list get index from value
["foo", "bar", "baz"].index("bar")
Example 2: python search list of lists for value return index
[(i, colour.index(c))
for i, colour in enumerate(colours)
if c in colour]
Example 3: python list find index of item
>>> ["foo", "bar", "baz"].index("bar")
1