8. Part of the whole


#1



https://www.codecademy.com/courses/python-beginner-en-qzsCL/1/4?curriculum_id=4f89dab3d788890003000096


get_class_average([alice, lloyd]) returned 80.55 instead of 85.85 as expected


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


#2

get_average(student)
You dont need it.

results.append(get_average(student))
Its not properly indented!


#3

Thanks!! I deleted that line before because it looked unnecessary, and it seemed to return a different wrong calculation..:confounded:


#4

result.append(get_average(student)) should be inside the for loop


#5

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