8. part of a whole


def get_class_average(class_list):
for student in class_list:
return average(results)
i am getting this error get_class_average([alice]) resulted in an error: ‘dict’ object has no attribute 'append’
i am stuck here for a while …can anyone you please correct the code for me …i cannot understand what is wrong …

Part of a Whole

so here:


you appending a list (results) to a dictionary (student), as the error message tells you, dictionary (student) doesn’t have a append method, given its a method for lists


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