PyDocs

Nav

Python Runtime Services

dict.setdefault

builtins

method of dict
  • dict.setdefault(key, default=None, /)
Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.
0 Examples
No examples for builtins/dict.setdefault.
See Also
No see-alsos for builtins/dict.setdefault
0 Notes
No notes for dict.setdefault