Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

find the first occurrence of item in a list in python

next(obj for obj in objs if obj.val == 5)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #occurrence #item #list #python
ADD COMMENT
Topic
Name
8+4 =