def average(numbers):
    """
    :param list[float] numbers: a list of numbers
    :returns: the average of the given number sequence. an empty list returns 0.
    :rtype: float
    """
    return float(sum(numbers)) / max(len(numbers), 1)