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