grades = [100, 100, 90, 40, 80, 100, 85, 70, 90, 65, 90, 85, 50.5] def grades_sum(grades): total=0 for i in grades: total=total+i return total def grades_average(grades): return grades_sum/float(len(grades)) print grades_average(grades) it returns error "TypeError: unsupported operand type(s) for /: 'function' and 'float'" Is there something wrong with my code? thanks!
Inside your grades_average function body, you are dividing
float(len(grades)). However, you should really be calling
grades_sum and dividing that by
float(len(grades)). Fix this up and you'll be good to go.
aha i find that
sooo careless i am
thank you so much!