Why the below one is not working for me


#1

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)
       results.append(x)
    return results
or 
results = results.append()

error:
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?
#2

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


#3

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


#5

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