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

Haralambos Tsivikas
Haralambos Tsivikas
7,225 Points

Hi I am stuck on this challenge. Any solutions;;

I have issues with the code

creating_dictionaries.py
student = dictionary{"name": "Oxford", "topic": "Python"}

4 Answers

Whats the question?

Haralambos Tsivikas
Haralambos Tsivikas
7,225 Points

Create a dictionary with the following key value pairs: 1) key: 'name', value: '', 2) key: 'topic', value: 'python'. Assign this dictionary to a variable called student.

student = dictionary{"name": 2, "topic": "Python"}

The value of name should be 2. Not sure were your value came from. What got me up on this when i was doing it was, i kept putting "2" and its just 2. Don't let it trip you up.

In creating a dictionary you don't use the word dictionary. As shown in the previous video @ 1:16 you specify key value pairs inside curly braces.

mydictionary = { 'key1' : 'value1', 'key2' : 'value2' }

Also check your values against what the instructions state. Case matters in task 2.