def average(values, lazy=False):
    """Calculate the average of a given number of values.

    :param values: The values to be averaged.
    :type values: list | tuple

    :param lazy: When ``True`` zeroes (0) are removed before averaging.
    :type lazy: bool

    :rtype: float

    Ever get tired of creating a try/except for zero division? I do.

    .. code-block:: python

        from commonkit.utils import average

        values = [1, 2, 3, 4, 5]
        print(average(values))

    """
    if lazy:
        values = [i for i in values if i != 0]

    try:
        return float(sum(values) / len(values))
    except ZeroDivisionError:
        return 0.0