from functools import reduce


def count_avg(list_of_values, scale):
    """
    Calculate average value of given list with given scale
    :param list_of_values: some list if int
    :param scale: int to round average meaning
    :return: average value
    """
    if list_of_values:
        avg = reduce(lambda x, y: x + y, list_of_values) / len(list_of_values)

        if scale > 0:
            return round(avg, scale)
        else:
            return round(avg)
    else:
        return 0