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


x = [lloyd, alice, tyler]

def get_class_average(students):
    results = []
    for student in x:
        a = get_average(student)
    return average(results)
    print average(results)


i would loop over the function parameter here:

for student in x:

this way, you can loop over different lists by passing the list as argument in the function call:

print get_class_average(x)

also, the exercise might require you to name the list from x to students


2 posts were split to a new topic: Student become teachers


A post was merged into an existing topic: Student become teachers


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