Search
 
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
Name
2+3 =