# Exam statistics - the sum of scores

#1

Hello.
I believe there is an error in the instructions of this exercise.

In the instructions it is written:
01. Takes in a list of scores, scores

When I put scores as the function parameter as shown bellow:

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

total = 0

I get this error message:
Oops, try again. It looks like your grades_sum function doesn't properly compute the sum of all the grades! It returned 1045.5 instead of 206 for grades_sum([5, 38, 0, 40, 48, 75])

When I put grades as my parameter the code works:

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

total = 0

`python

P.S. I don't understand how I can put the code in this message with the right tabs(spaces)

#2

you should loop over grades, this will make your function only work for a single list. What now if you add a second function call:

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

total = 0

print grades_sum([5, 38, 0, 40, 48, 75])``````

your function doesn't work for both lists, it should

#3

Now it does work for all lists

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

total = 0