due: Tue, November 21, 8pm
Review the class notes for this week.
Modify your dictionary lookup program from last week so that any new definitions added by the user are saved from one run of the program to the next. To do this, when the program exists, save your dictionary as JSON into a file. You will have to modify your program so that when it starts, it first loads this JSON file into your dictionary. You can either manually create a JSON file by hand to start (you could put the definitions you started with last time in here) or add code to check whether the JSON file exists.
import json, then
uses open() to read the contents of a file, then
uses json.loads() to interpret the contents of that
file as a JSON string, and then finally uses
a while loop to iterate over the data structure
that comes from loading the JSON string.
As an example, you can also consider referencing the Week 6 homework that added a new item to a "herd of creatures" every time the user pressed a key.