The sum of scores


#1

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
grades_sum()
print x


#2

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.


#3

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