get index of occurrences in list python code example
Example 1: python index of item in list
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"]