5. Computing the average syntax error


Hey guys, i keep getting a syntax error as seen below

I know there must be some silly syntax error, but I just can't find it. Would appreciate a hint, thanks.

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

def grades_sum(scores):
    for i in scores:
    return total
def grades_average(grades):
    avg=grades_sum(grades) / float(len(grades)
    return avg
print grades_sum(grades)    
print grades_average(grades)


avg=grades_sum(grades) / float(len(grades)

Here, you forgot to close the bracket. Add another ) after float(len(grades).


That was it, thank you!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.