grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5]
total = 0
for m in grades:
total += m
return float(grades_sum(grades) / (len(grades)))
gives an error 'Oops, try again. grades_average([5, 0]) returned 2.0 instead of the expected: 2.5'
However, if I change the second last section of my code to the following,
return grades_sum(grades) / float(len(grades))
it works by attaching float fx to len(grades). I thought attaching float will give same result, but it apparently doesn't. Can someone explain please?
Replace this line with your code.