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


#1



x = [lloyd, alice, tyler]

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


#2

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


#3

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


#4

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


#5

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