The sum of scores


#1



So, i return the value of total and it gives me an error saing to print the value, and when i change return to print, there's an error saing to return the value.
please help me

i need to sum all values on grades


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

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

grades_sum(grades)


#2

to print what is returned print needs to be called on the function call:

print grade_sum(grades)

#3

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