def first_or_default(items, default=None):
 for item in items:
  return item
 return default

def first_or_default ( items , default = None ) : for item in items : return item return default
helper method to fetch first element of list .