All problems
EasyDicts
dict.get with default
Use `dict.get(key, default)` to avoid a KeyError on a missing key.
- #dict
- #get
Sample input
{"a": 1}, get("b", 0)Sample output
0
dict-get-default.py
Output
Press "Run code" to execute.
Loading…
Use `dict.get(key, default)` to avoid a KeyError on a missing key.
{"a": 1}, get("b", 0)0
Press "Run code" to execute.