Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialmichaelmaguire
2,151 PointsKeep getting NameError for first Dictionary Challenge Task and unsure what is wrong with my code!?
I keep getting a NameError when running the attached code and am running into a wall as to what is wrong.. any idea why?
The questions is: Make a dictionary named player and add two keys to it. The first key should be "name" and the value can be any string you want.
The second key should be "remaining_lives". Set this key's value to 3.
Thanks!
player = {"name": "Link", "remaining_lives": 3}
2 Answers
Eric M
11,546 PointsHi Michael,
The good news is you've created a valid Python dictionary. The bad news is I think something has gone a bit wonky with this code challenge. I could be wrong but I've reported it up the chain to be checked out.
In the meantime please continue with the next item in the course while this challenge gets a closer look (you can skip around from the circular breadcrumbs at the top of the videos and challenges).
I've quickly checked out the next challenge in this course and it's working fine. It's also not too long ago that I ran through the Python tracks myself (maybe two months ago) and they were without issue, so I'm sure this'll get fixed up ASAP.
Cheers,
Eric
Steven Parker
231,275 PointsYou code looks correct, there might be a bug in the validation mechanism. You may want to make a bug report to the Support folks.
michaelmaguire
2,151 PointsThanks for confirming!
Eric M
11,546 PointsEric M
11,546 PointsHi Michael,
To add to this. I am seeing this in some other Python code challenges as well. Unfortunately the main support team works on US time, so it might be a little bit before this gets fixed. Fingers crossed.
Cheers,
Eric
michaelmaguire
2,151 Pointsmichaelmaguire
2,151 PointsThank you, much appreciated!