def avg(iterable):
    """
    Return the average value of an iterable of numbers
    """

    # the iterable can be an iterator that gets exhausted
    # while `sum` and `len` will return 0
    list_copy = list(iterable)
    if not list_copy:
        return None

    return sum(list_copy) / len(list_copy)