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

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,858 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.