DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
5+3 =
Submit