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

Joshua Smith
Joshua Smith
3,585 Points

What is this asking? I'm confused because my code does what I think this wants from me...

If I write student = {'name':'', 'topic':'python'} topic = student['topic']
the challenge tells me I assigned topic the incorrect value...but the question is asking me to set it to the variable of the value of the topic key, which is python. ...

creating_dictionaries.py
student = {'name':'', 'topic':'python'}
topic = student['topic']

7 Answers

You're doing the right thing, if you're assuming this is testing your ability to retrieve the value using the technique taught in the video. I made that assumption too, and was similarly frustrated. Then, I tried interpreting the challenge instruction boneheadedly literally, and simply assigned the value of that key (the string 'python') to the variable, and it passed.

Not sure what the point of having us do that was, but that solves the problem.

Except now it fails. I think they're editing the challenge as we speak.

Josh Keenan
Josh Keenan
20,315 Points

The challenge has an issue, you need to change topic to 'Python' with a capital P to pass the second challenge.

https://teamtreehouse.com/community/issue-with-challenge

Joshua Smith
Joshua Smith
3,585 Points

I think you might be right! I just got through by changing it from 'python' to 'Python' in both the dictionary and the variable, although still not the way I believe it was intended!

I'll try that. Strength in numbers.

You're right, that worked. Jeez, what a mess.

JongHo Kim
JongHo Kim
8,313 Points

Yeah, I noticed that there were errors like these in the new courses. They're probably still fixing some errors or are unaware.