def median(values=None):
    """Return the median of 'values'

    Keyword arguments:
    values -- the list of numbers
    """
    sorts = sorted(values)
    length = len(sorts)
    result = None
    if not values:
        result = 0
    elif not length % 2:
        result = (sorts[length // 2] + sorts[length // 2 - 1]) / 2.0
    else:
        result = sorts[length // 2]
    return result
