Computing the Average


Oops, try again. You did not print the correct average. Double-check your code and make sure you print the average!

can't see where my grades_average is not printing the correcnt average.

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

def grades_sum(scores):
    result = 0
    for s in scores:
        result += s
    return result
print grades_sum(grades)

def grades_average(grades):
    average = float(grades_sum(grades)//(len(grades)))
    return average
print grades_average(grades)


step 3:

Computes the average of the grades by dividing that sum by float(len(grades))

dividing is done with /, // will also floor the number, we don't want this

and you don't use float() to cast the length of grades to a float


Thank you for the help. Solved