get all elements within 2 position python code example
Example 1: get all indices of a value in list python
indices = [i for i, x in enumerate(my_list) if x == "whatever"]
Example 2: python index for all matches
indices = list(filter(lambda x: x == 'whatever', my_list))