I'll explain my changes.

- Using **"with open..."** is a Python idiom, guaranteeing that no matter what happens when accessing the file (e.g. exceptions), Python will make sure it'll be closed properly. This also makes the use of the file.close() method redundant.

- Line 31: dictionaries have a method called **get(key, default=None)**.
It returns the value matching the specified key, or returns the default value if the key isn't found.

- Regarding formatting, Python PEP8 states: **Use 4 spaces per indentation level.**