Exercise: Computing the average, exam statistics.
I receive this error message: Oops, try again. grades_average([1, 6, 2, 4]) returned 3 instead of the expected: 3.25
In the console my result turns out to: 80.4230769231 - Which I believe is correct?
Can someone please explain what I need to change? Because I think I'm getting the correct answer, I don't really understand the reason for the error message, thank you!
Here is my code below:
grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5] def grades_sum(scores): total = 0 for score in scores: total = total + score return total def grades_average(scores): return grades_sum(scores) /len(scores) print grades_average(grades) #80.4230769231