How to find all occurrences of an element in a list
Asked 07 September, 2021
Viewed 1.5K times
  • 55
Votes

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?

17 Answer