def grade_distribution(parsed_list, max_grade, bin_number=10):
    """
    This funtion calculates the distribution of the given grades by splitting
    them into 'n' equal bins (intervals) and finding the number of grades
    corresponding to each bin. The bins are left-closed, right-open:
    [a, b) = x | a <= x < b, except from the last one that is closed:
    [c, d] = x | c <= x <= d.

    :param parsed_list: the parsed list of the grades
    :param max_grade: the maximum grade that you can score
    :param bin_number: the number of bins that is calculated in the
    distribution, default is 10
    :return: a list of the number of grades in each bin
    """
    bin_length = max_grade / bin_number
    grade_distribution_list = [0] * bin_number

    for item in parsed_list:
        index = int(item / bin_length)

        if index == bin_number:
            grade_distribution_list[index-1] = (
                grade_distribution_list[index-1] + 1
            )

        else:
            grade_distribution_list[index] = grade_distribution_list[index] + 1

    return grade_distribution_list