Part of the Whole - please help!


#1

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

please help!

Oops, try again. get_class_average([alice]) returned 83.8666666667 instead of 91.15 as expected


#2

First of all, this is a python course you're posting about not an AngularJs course. :sweat_smile:


#3

Second, call this line outside any function so that it can have a global scope.

Third, Your code should be indented like this, common mistake.

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

#4

oops.........

and thanks now it's works!


#5

If that was the answer you were looking for feel free to press the solution button below my reply. :grin: