4/9 error message


#1

What is wring with this ? It computes the right answer. ( I know it is more complicated than it has to be)
def grades_sum(scores):
total=0
index=0
for i in range(len(grades)):
total= total + grades[index]
index+=1
return total
print grades_sum(grades)

gives this error message: Oops, try again. It looks like your grades_sum function doesn't properly compute the sum of all the grades! It returned 1045.5 instead of 10 for grades_sum([10])


#2

nevermind. I used grades instead of scores. otherwise it works


#3
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)