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

Ava Jones
Ava Jones
10,682 Points

What am I doing wrong

I have no idea what is wrong, please help

creating_dictionaries.py
student = {'topic': 'python'}

3 Answers

Here is one way of doing it!

#Task 1 of 2
student = {
    'name': 2,
    'topic': 'python'
}
# Task 2 of 2
topic = student['topic']
Ava Jones
Ava Jones
10,682 Points

Thank you! It helped !

There is nothing wrong with what you are doing! The question wants you to have two key-value but you have only given one

1) key: 'name', value: 2,

2) key: 'topic', value: 'python'.

Ava Jones
Ava Jones
10,682 Points

Thank you so much for helping

Asher Orr
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Asher Orr
Python Development Techdegree Graduate 9,409 Points

Hi Ava!

The challenge says to include both key:value pairs in the dictionary.

You added the second key:value pair (key: 'topic', value: 'python') correctly. You just need to add the first one:

key: 'name', value: ''

Like this:

student = {key:value, 'topic':'python'}
Ava Jones
Ava Jones
10,682 Points

Thank you for helping me again!

Ava Jones
Ava Jones
10,682 Points

Hold on I still got an error, it said that key is not defined