def finditem(func, seq):
 return next((item for item in seq if func(item)))

def finditem ( func , seq ) : return next ( ( item for item in seq if func ( item ) ) )
finds and returns first item in iterable for which func is true .