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

Casper Zaar
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
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
208,480 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
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.

silasholt
silasholt
4,180 Points

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!