Defining get_class_average in Part of a Whole


#1



I have made sure everything else in my code is correct but when I submit my code it tells me I haven't defined the function "get_class_average". Am I missing something?


 def get_class_average(students):
        results = []
        for student in students:
            results.append(get_average(student))
            return average(results)


#2

when function sees return statement at first iteration it halts the execution after appending the first average and it does not append other average values of students.

Indentation of return statement is not correct.
Make sure that function's header is 0-spaced.


#3

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