Exam Statistics: Computing the Average


#1


https://www.codecademy.com/courses/python-intermediate-en-7mgOa/1/2?curriculum_id=4f89dab3d788890003000096#

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)


#2

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


#3

Hahaa. wow. thank you!