The sum of scores


Hi guys,
I do not know what I am doing wrong in here. Can anyone help me?

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

def grades_sum ():
total = 0
for scores in grades:
x = sum(scores)
return x
print x


Okay, I would have loved you formatted your code, so I see your indentation. That said,

Your function should take a list of scores

Your sum here:

You should be looking to add x to scores in an "iterable" manner.

Please, print in one line the newly created grades_sum() function and call it with the list of grades.


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