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!

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 Python Collections (2016, retired 2019) Dictionaries Dict Basics

confused about a quiz question (dict basics)

set the key color to the value 'red'.

my_car[ _____________ ] = ______________

in the first blank I put: "lambo", and in the second blank I put: {"red"}

I got an error: Bummer! Unfortunately, that answer is incorrect.

what am I doing wrong?

2 Answers

28,556 Points

The first blank should contain the key you are modifying/creating and the second blank should contain the value.

That means that you are creating a key called "lambo" and setting the value to a dictionary containing the string "red", which is not really what the quiz asks for.

The key should simply be "color" and the value just the string "red" like this:

my_car["color"] = "red"

Resurrecting this as I did the above:

my_car["color"] = "red"

and it returned an incorrect answer. Apparently the editor only accepts single quotes?

my_car['color'] = 'red'

Really destroyed my brain for a sec.