python find item in list and return index code example
Example 1: python find index by value
>>> ["foo", "bar", "baz"].index("bar")
1
Example 2: get index of all element in list python
indices = [i for i, x in enumerate(my_list) if x == "whatever"]