def mean(iterable):
    """
    Compute the mean value of the entries in {iterable}
    """
    # make an iterator over the iterable
    i = iter(iterable)
    # initialize the counters
    count = 1
    total = next(i)
    # loop
    for item in i:
        # update the counters
        count += 1
        total += item
    # all done
    return total * 1/count