I am studying the solution code for Step 3 and it makes no sense to me. I also copied and pasted the solution code for Step 3 into my code box and received a NameError warning. These are all the codes that I have so far …
I don’t understand why I was instructed to call the function add_gamer with gamers as the second argument. Why gamers? gamers is supposed to be the holding list for all the people who will attend the game night. I was instructed to created an empty list called gamers as the very first line of code. Also, it’s this very same second argument of gamers that I receive the following message …
Hi janbazant. Thank you for being here! I’m going cross-eyed trying to figure out why I still keep getting that NameError for a not defined “gamers.” Please see screenshot below … Please note that my screenshot cut off my first line of code which is gamers =
Thank you janbazant! I literally spent half this morning and an hour just now running and rerunning the code over and over again. I followed your directions and went to each cell and ran each one again. It cleared! No NameError! What happened? Anyway, I am glad it worked. Very relieved.
Now that the second argument gamers is not giving me an Error, can you help me understand why it’s the second argument? Why is the first code that I wrote at the top of the page the second argument here in the add_gamer function?
You said games = … sorry I’m not seeing where this is. Did you mean gamers = which is at the top of the code?
This recycling and mixing of gamers and gamers_list throughout the Code Solution is very confusing to me.
I’ve moved on to Step 6 and here again the Code Solution uses the term gamers_list instead of gamers and I am confused! The instructions actually say that the function should iterate through each gamer in gamers_list … the instructions didn’t say to iterate in ‘gamers.’ But I thought that ‘gamers’ is the master list and ‘gamers_list’ is not … because ‘gamers_list’ is just a second argument for a function?!
Me again. Back at it. New day. Fresh perspective. So, the ‘gamers’ which is the second parameter in the add_gamer function is the exact same as the ‘gamers’ list which we wrote as the first code in this project. Correct?
Just ran into this problem myself. Jupyter Notebooks wanted to run the empty list first. The ‘name error’ was due to the list not being added to the running code block until tested. Thanks a bunch! This was going to bug the crap outta me!