Just Weight and See


#1



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


I could use some help here! It keeps throwing up the error "get_average(alice) raised the following error: local variable 'homework' referenced before assignment". I'm not entirely sure what that means in context. How should I go about fixing this? Thanks in advance for the help!



#2

You didn't assign total to sum(numbers). That's where your error is coming from :slight_smile:

'Edit': Also, take a look at what @stetim94 said, that will throw an error too.


#3

homework is a undefined variable. Look at the dictionary keys, they are strings, so why not use a string when trying to access the value of dictionary?


#4

he did on line 23, line 22 is currently not doing anything (well, its getting the sum but then not doing anything with it)


#5

Oops, my apologies, I just noticed that @stetim94.


#6

Using a string to access the dictionaries fixed it! Thanks for the help!


#7