Python Python Collections Dictionaries Dictionary Basics

Keep 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!

dicts.py
player = {"name": "Link", "remaining_lives": 3}

2 Answers

Eric McKibbin
MOD
Eric McKibbin
Treehouse Moderator 10,976 Points

Hi 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

Eric McKibbin
Eric McKibbin
Treehouse Moderator 10,976 Points

Hi 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

Thank you, much appreciated!

Steven Parker
Steven Parker
149,192 Points

You code looks correct, there might be a bug in the validation mechanism. You may want to make a bug report to the Support folks.

Thanks for confirming!