Why is the average returned incorrect?

A post was split to a new topic: A decent explanation

can you please explian the difference?

Can anyone tell me why my class avg is 83.8 , and not 85?
def get_class_average(class_list):

results =

for student in class_list:



return average(results)

whole_class = [lloyd,alice,tyler]

print get_letter_grade(get_average(tyler))

print get_class_average(whole_class)

Thanks, the issue was same with me.I don’t understand why it is wrong to define the results outside the function.