I tested this code in a shell but it won't work on codecademy


#1



It returns 'None' when run on codecademy, but it returns the correct result when run in terminal.


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

def grades_sum(grades):
    total = 0
    for grade in grades: 
        total += grade
    print total


#2

This is not a return value.

return total

#3

Thanks, I changed it to test the result, sorry.


#4

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