DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
find string in list and return index python
As a list comprehension: [i for i, j in enumerate(['foo', 'bar', 'baz']) if j == 'bar']
PREVIOUS
NEXT
Tagged:
#find
#string
#list
#return
#index
#python
ADD COMMENT
Topic
COMMENT
Name
2+3 =
Submit