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 trialKevin Lieu
4,329 PointsNow add a "levels" key. It should be a list with the values 1, 2, 3, and 4 in it. Not sure how to perform this task.
Not sure what I am doing wrong.
player = {'name': 'Kevin', 'remaining_lives': 3, 'levels': ([1,2,3,4]), 'item': {'superp': 'man'}
1 Answer
Steven Parker
231,275 PointsThe "levels" part of the task is OK.
But you added a key named item when the challenge asked for items (plural). Also, it looks like you are missing the final close bracket ("}
") on the outer dictionary.
Also, the parentheses enclosing the levels list are not necessary.
Dustin James
11,364 PointsDustin James
11,364 PointsSteven, you beat me again...
Kevin,
Try to add the new key: value pairs outside of naming the 'player' variable. I'm not sure this is a requirment of the challenge, but seeing as the first part is only wanting you to declare 'player' with two key: value pairs and the second part of the challenge is wanting you to add levels and items.
Kevin Lieu
4,329 PointsKevin Lieu
4,329 PointsThank you Steven.