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

Casper Zaar
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Casper Zaar
UX Design Techdegree Graduate 11,088 Points

On an empty line beneath the existing code, create a variable called topic and assign to this variable the value of the

What am I doing wrong here? :-/

creating_dictionaries.py
student = {'name':'Casper', 'topic':'Python'}

topic = student['topic']
Casper Zaar
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Casper Zaar
UX Design Techdegree Graduate 11,088 Points

"On an empty line beneath the existing code, create a variable called topic and assign to this variable the value of the topic key in the student dictionary."

There was the whole task.

2 Answers

Steven Parker
Steven Parker
231,236 Points

Your task 2 code is good, but for task 1 the challenge asked you to create the value '' (an empty string) to go with the 'name' key, and the value 'python' (with a lower-case "p") to go with the "topic" key.

Apparently it did not notice that you assigned different values until checking task 2.

Casper Zaar
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Casper Zaar
UX Design Techdegree Graduate 11,088 Points

Thanks Steven!

I just thought that I should enter my own name and it worked ;-) Thanks for clearing that up. Now I can move on.

Hey just to let you know the Values are case sensitive!! I had {'name': 'Silas' , 'topic': 'Python'} this code would not work when trying to get 'topic' value I changed the values to lowercase and it worked! Just Thought I would let y'all know

Thank you Silas! Lowercase value worked!