Computing the Average

#1

Need some help with this problem

``````Replace this line with your code.
average = 0
average += x
t = float(len(average)) /13
return t``````

#2

HI the instruction says..
Define a function grades_average(), below the grades_sum() function that does the following:

01. Has one argument, grades, a list

``def grades_average(grades):``

02. Calls grades_sum with grades `(you should call the function grades_sum with the argument grades and saved it inside a variable)`

``````def grades_average(grades):

you can change the name sums with any name you want...

03. Computes the average of the grades by dividing that sum by float(len(grades)).
in this case the sum will be the sums variable where we saved grades_sum(grades)

``````def grades_average(grades):

you can change the name G_average with any name you want...

04. Returns the average.

``````def grades_average(grades):
return G_average``````

#3

Sorry for the late reply & thanks brother, I appreciate the help.

#4

I think my code looks like yours but I get a syntax error that I didnÂ´t get before. I don't see the problem?

``total = (summa / float(len(grades)) <-- add it here``