Computing the Average


#1



Need some help with this problem :sweat_smile:

https://www.codecademy.com/courses/python-intermediate-en-7mgOa/1/2?curriculum_id=4f89dab3d788890003000096#


Replace this line with your code. 
def grades_average(grades):
    average = 0
    for x in grades:
        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):
    sums = grades_sum(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):
    sums = grades_sum(grades)
    G_average = sums / float(len(grades))

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

04. Returns the average.

def grades_average(grades):
    sums = grades_sum(grades)
    G_average = sums / float(len(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?

def grades_average(grades):
summa = grades_sum(grades)
total = (summa / float(len(grades))
return total

print grades_average(grades)


#5

Hi this line

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

didn't close one )