how to get index of an element in list in python code example
Example 1: get index of list python
list.index(element)
Example 2: python list get index from value
["foo", "bar", "baz"].index("bar")
Example 3: get index of all element in list python
indices = [i for i, x in enumerate(my_list) if x == "whatever"]