fast way to get index of element in list code example
Example 1: get index from element in list python
list.index(element)
Example 2: get all index of item 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"]