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 trialDavid Garcia
Python Development Techdegree Graduate 11,254 Pointspython dictionaries
I need help, I don`t know how to add a list to my dict..
player = {"name": "David", "remaining_lives": 3, "levels": 1,2,3,4 , "items":{"weapons":"sword"}
1 Answer
Kyle Gunby
23,838 PointsYou need to wrap the list in brackets. Also, you are missing a closing curly bracket.
player = {"name": "David", "remaining_lives": 3, "levels": [1,2,3,4] , "items":{"weapons":"sword"}}
Chris Freeman
Treehouse Moderator 68,457 PointsChanged to answer.
David Garcia
Python Development Techdegree Graduate 11,254 PointsDavid Garcia
Python Development Techdegree Graduate 11,254 Points@Kyle Gunby thank you very much i did that initially but it did not work, but then i realized the reason it did not work is because I forgot to end the line of code that you included.