This is fine for now; however, in the future, try using .get() on a dictionary as it won't throw a KeyError when the dictionary key doesn't exist.