Exam Statistics: Computing the Average



Not sure why i'm getting the following error when the code is computing the average correctly?
error message: "try again. You did not print the correct average. Double-check your code and make sure you print the average!"

My code is return the correct average, but i still get the error message

grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]

def grades_average(grades):
    def grades_sum(scores):
        sum_scores = 0
        for i in scores:
            sum_scores += i
        return sum_scores
    return round(grades_sum(grades)/float(len(grades)),2)

print grades_average(grades)


Hint: Did the exercise expect you to round the answer? :wink:


Hahaa. wow. thank you!