How to find all occurrences of an element in a list
index()
will give the first occurrence of an item in a list. Is there a neat trick which returns all indices in a list for an element?
index()
will give the first occurrence of an item in a list. Is there a neat trick which returns all indices in a list for an element?