# 4. The sum of scores

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>
It says
Oops, try again.
9, 28, 62, 74, 11, 5, 97])

<What do you expect to happen instead?>

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

total = 0
total = total + i

``<do not remove the three backticks above>``

All this isn’t necessary just simply iterate through grades.

``````for i in grades:
``````

Tried it but it gets this:
Oops, try again.
sum of all the grades! It returned 1045.5 instead of 278 for
grades_sum([40, 45, 10, 61, 23, 99])

``````
``````

…Wha…?
So like this?
I get
Oops, try again.
recursion depth exceeded for grades_sum([55, 1, 79, 41, 34, 47, 24])

No i mean in your function call

``````def grades_sum(grades):
``````

Oh! Well I did that now, but… It said I have to print grades_sum() so I put

total = 0
total = total + i

buuuuut it still tells me to print it and if I unindent it it says

Traceback (most recent call last):
File “python”, line 8, in
TypeError: grades_sum() takes exactly 1 argument (0 given)
so…

Is your for loop indented like this,

``````for i in grades:
total += i
``````
``````grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]

total = 0
total = total + i
``````

Doesn’t work.
File “python”, line 7
^
IndentationError: unindent does not match any outer indentation level

No I mean like this,

``````def grades_sum(grades):
total = 0
total += i

``````
``````def grades_sum(grades):
total = 0
total += i

``````

Of course that didn’t work, since return needs to be inside the function.

No no if you indent the return and for loop to the correct indentation like this,

``````def grades_sum(grades):
total = 0
total += x
I just wanted to give you something to solve. 