The sum of scores HELP


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

def grades_sum(scores):
    total = 0
    for i in grades:
        total += i
    return total
print grades_sum(grades)

*Oops, try again. It looks like your grades_sum function doesn’t properly compute the sum of all the grades! It returned 1045.5 instead of 89 for grades_sum([39, 50])

I do not understand the error? Who can help me with this?


#2

That is calling the global object. Use your parameter, scores.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.