def first_match(predicate, iterable):
 for item in iterable:
  if predicate(item):
   return item
 return None

def first_match ( predicate , iterable ) : for item in iterable : if predicate ( item ) : return item return None
gets the first element matched by the predicate in the iterable .