def avg_and_total(iterable):
 items = 0
 total = 0.0
 for item in iterable:
  total += item
  items += 1
 return ((total / items), total)

def avg_and_total ( iterable ) : items = 0 total = 0.0 for item in iterable : total += item items += 1 return ( ( total / items ) , total )
compute the average over a numeric iterable .