Словарь Python получите значение, если существует ключ
val = dict.get(key , defVal) # defVal is a default value if key does not exist
Breakable Bee
val = dict.get(key , defVal) # defVal is a default value if key does not exist