Why the below one is not working for me


can you help me - Why the below one is not working for me.

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

Oops, try again. get_class_average([alice]) resulted in an error: global name 'results' is not defined

Lesson 8: part of the whole, what am I doing wrong?

yes it should be only one equal sign(results=[] ;double equal signs are used for checking purposes


two equal signs mean check if equal, which doesn't make much sense at this point. Here you want to store an empty list in results variable, this is done with a single equal sign


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