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 trialAlex Life
16,114 PointsOrderedDict practice
Oops! it looks like task 1 is no longer passing... Balogna.
Challenge in task one is to import OrderedDict from collections Challenge in task two is create an OrderedDict named menu with the keys and values exactly as they are in the comments. Both key and value will be a string.
Where am I wrong?
## Menu Items:
# 'n', 'new challenge'
# 's', 'new step'
# 'd', 'delete a challenge'
# 'e', 'edit a challenge'
from collections import OrderedDict
menu = OrderedDict([
('n', 'new challenge')
('s', 'new step')
('d', 'delete a challenge')
('e', 'edit a challenge')
])
Steven Parker
231,236 PointsYou didn't delete the question, do you still want an answer?
1 Answer
ass hen
Courses Plus Student 674 Pointstry this from collections import OrderedDict
Menu Items:
'n', 'new challenge'
's', 'new step'
'd', 'delete a challenge'
'e9, 'edit a challenge'
menu = OrderedDict([ ('n', 'new challenge'), ('s', 'new step'), ('d', 'delete a challenge'), ('e', 'edit a challenge') ])
Alex Life
16,114 PointsAlex Life
16,114 Pointsjk, stupid commas.