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 trial

Python Introducing Dictionaries Introducing Dictionaries Creating a Dictionary

Josh Keenan
Josh Keenan
19,652 Points

Issue with challenge

So no matter what code i submit for this it fails and throws me this error:

Bummer: Whoops, looks like the topic variable is assigned to the wrong value. Check that the topic key has the correct value in the student dictionary, and check that you're accessing this value correctly.

I have rewritten this and tested it on my machine and googled it, I am 100% sure my code has no issues but I still get this error every time I try to recheck it.

creating_dictionaries.py
student = {"name": "j", "topic": "python"}
topic = student.get('topic')
Josh Keenan
Josh Keenan
19,652 Points

have also used:

student = {"name": "g", "topic": "python"}
topic = student["topic"]

2 Answers

Steven Parker
Steven Parker
229,732 Points

There's a bug in the instructions. It should have told you to use "Python" (with capital "P") as the value for topic instead of "python".

This was previously discovered by another student, but it probably wouldn't hurt to send another bug report in to the Support folks.

James Arnold
James Arnold
3,986 Points

In my case I had to change 'Python' to 'python' for the code to be accepted.

Michael McGill
Michael McGill
2,085 Points

as of September 11 2019, in this exercise, you no longer need python spelt with a capital 'P' as before. I read this thread when I was struggling with it and, changed my python to Python because I remembered the same thing happened on a previous challenge exercise. That was before I had figured out the correct code. But by the time my code was correct, no matter what I did, it wouldn't pass me. I was sure my code was correct. Well when I changed it back to lower case 'p' I passed it. Someone needs to delete those posts so they don't keep tripping people up.