def mean_with_default(l, default_val):
  """Returns the mean of the list l.

  If l is empty, returns default_val instead

    Args: l (iterable[float | int]) default_val
  """
  if len(l) == 0:
    return default_val
  else:
    return float(sum(l)) / len(l)