Python Using Databases in Python Our Diary App OrderedDict Practice

OrderedDict 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')

jk, stupid commas.

Steven Parker
Steven Parker
204,019 Points

You didn't delete the question, do you still want an answer?

1 Answer

try this from collections import OrderedDict

'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') ])