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 trialPerfect Tinotenda Mashingaidze
5,070 PointsLevels key
Can any one clarify me on this part of question
player = {"name": "perfect", "remaining_lives": 3, "levels": "[1,2,3,4]", "items": "tino"}
2 Answers
Dave StSomeWhere
19,870 PointsI'm pretty sure the goal of the challenge is to show you that dictionaries can contain lists or dictionaries (nested)
There are many types of entries for dictionaries - try something like below:
a = {"key1":"value1", "list1":[1, 3, 5, 7], "dict1":{"nested_key1":"nested_value1"}}
print(a)
# output
{'key1': 'value1', 'list1': [1, 3, 5, 7], 'dict1': {'nested_key1': 'nested_value1'}}
# or check a specific key
print(a['dict1'])
# output
{'nested_key1': 'nested_value1'}
Maybe these will help:
Sandy Goreraza
7,391 PointsSince you were answered by Dave, i no-longer see it necessary for me to help you out on the challenge .The solution Dave wrote is correct.Lastly, you did not highlight what the question was for the above list dictionary.
Perfect Tinotenda Mashingaidze
5,070 PointsPerfect Tinotenda Mashingaidze
5,070 Pointsplayer = {"name": "perfect", "remaining_lives": 3, "levels": [1, 2, 3, 4] "items": {"tino":"pythonista"}}
I keep having bummer wat should do im out of ideas
Dave StSomeWhere
19,870 PointsDave StSomeWhere
19,870 PointsYou need a comma before "items"
Perfect Tinotenda Mashingaidze
5,070 PointsPerfect Tinotenda Mashingaidze
5,070 PointsDave i did put the comma but i got no lucky bra its stil sayin bummer
Dave StSomeWhere
19,870 PointsDave StSomeWhere
19,870 PointsNot sure where you put the comma but below passes the challenge:
player = {"name": "perfect", "remaining_lives": 3, "levels": [1, 2, 3, 4], "items": {"tino":"pythonista"}}
Perfect Tinotenda Mashingaidze
5,070 PointsPerfect Tinotenda Mashingaidze
5,070 PointsYah thankx man im really great full it worked...thankx a lot in my home langauge waka nyanya wakuseri