What\'s the most succinct way of saying, in Python, \"Give me dict[\'foo\'] if it exists, and if not, give me this other value bar\"? If I were using a
dict.get(key, default) returns dict[key] if key in dict, else returns default.
Note that the default for default is None so if you say dict.get(key) and key is not in dict then this will just return None rather than raising a KeyError as happens when you use the [] key access notation.