4.the sum of scores


#1



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

my code is right I think , but it shows error that ''ops, try again. It looks like your grades_sum function doesn't properly compute the sum of all the grades! It returned None instead of 445 for grades_sum([70, 88, 16, 89, 0, 76, 14, 92])''.


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=total+i
    print total
grades_sum(grades)


#2

Point1.
print total ?
You have to do this..
back to instruction..

Returns the computed sum

point2.
grades_sum(grades)
back to instruction
You have to print it?

Call the newly created grades_sum() function with the list of grades and print the result.


#3

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