Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Introducing Dictionaries Introducing Dictionaries Creating a Dictionary

Introducing dictionaries challenge task 2

I just don't know what i'm doing wrong. keeps saying try again.

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

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,624 Points

Hi Angel,

You're on the right track but just a bit mixed up.

To retrieve the value in the dictionary, you are correct with student['topic']. However, this is what needs to be assigned to the new variable. On the first line, you assigned the dictionary to the variable student, you'll notice that student does not have quotes surrounding it.
For the second task, you have to assign the value to a variable named topic, so topic will not have quotes and needs to be on the left side of the assignment operator.

So, just take what you have... flip it around and lose the quotes for the variable name.

Rest looks good! :thumbsup:

:) :dizzy:

For task 2 the variable will be on the left hand side and won't be enclosed in quotes.