Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

find all occurrences of an element in a list python

indices = [index for index, element in enumerate(a_list) if element == 1]
Source by www.kite.com #
 
PREVIOUS NEXT
Tagged: #find #occurrences #element #list #python
ADD COMMENT
Topic
Name
5+3 =