Python Introducing Dictionaries Introducing Dictionaries Creating a Dictionary

Caroline Louw
Caroline Louw
12,155 Points

What is wrong with my code? Is the key value pair in the dictionary wrong in this challenge?

In python dictionaries
student = {'name': 'caroline', 'topic': 'life science', 'value':'python'}
topic = student['topic']

1 Answer

Rick Gleitz
Rick Gleitz
41,875 Points

Hi Caroline,

I'm not sure how it let you pass the first task. But it did and that caused you to fail the second (your code was correct for the second task). The first task just wanted an empty string '' as a value for the key called 'name', and the string 'python' for the key called 'topic'. That's it, don't add other things in.

Hope this helps!