Python Using Databases in Python Our Diary App Switching It Up

Dara Roberts
Dara Roberts
Pro Student 3,186 Points

Name error persisting after moving OrderedDict to the bottom of file

After moving the OrderedDict to the bottom of the file

menu = OrderedDict([
    ('a', add_entry),
    ('v', view_entry),

if __name__ == '__main__':

My command line returns this error:

Action: a
Traceback (most recent call last):
  File "", line 56, in <module>
  File "", line 31, in menu_loop
    choice = input('Action: ').lower().strip()
  File "<string>", line 1, in <module>
NameError: name 'a' is not defined