Activity 1: Find Occurrences of an Element in a List Create a function that returns the index or indices of all occurrences of an item in the list. Note If an element does not exist in a list, return []. Lists are zero-indexed 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))