Few minor changes.

Why are you using dict.get(key) instead of dict[key]? Use dict.get only when you want to return a default value if key is not found.