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

Robert Baucus
Robert Baucus
3,400 Points

Dictionary Basics, Task 1 of 2, won't accept answer even though answer seems correct!

Hi,

I put the following code into the challenge Quiz:

player = { "name" : "Diarrhea Jones" , "remaining_lives" : "3" }

And the quiz gives me the dreaded " Bummer" error message:

player['remaining_lives'] does not equal '3'

As far as I can tell I have setup the dictionary properly and spelled the words correctly and it works in the Python shell and Workspace.

These quizes are super difficult to get to work! ARGHGHG!

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey Robert,

You're on the right track, but you didn't assign the correct value to remaining_lives. Right now you are assigning a string (you have surrounded the 3 with quotation marks)... so not a numerical value. Which means, then, there really aren't any lives remaining. You need to be assigning an Integer as the value.

player = {"name": "Diarrhea Jones", "remaining_lives": 3}

Keep Coding! :) :dizzy:

Robert Baucus
Robert Baucus
3,400 Points

I get it. I totally forgot about that. Thanks!