Exam statistics 5/9 HELP


#1

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

def grades_sum(scores):
total = 0
for i in scores:
total += i
return total

print grades_sum(grades)

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

print grades_average(grades)

Whats wrong?


#2

never mind i was supposed to put the grades_sum into the divsion


#3

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

def grades_sum(scores):
total = 0
for i in grades:
total += i
return total

def grades_average(grades):
total = 0
for i in grades:
total += 1
average = float(grades_sum(grades)) / total
return average

print grades_average(grades)