Python Dictionary setdefault() Method
The setdefault() method returns the value of the item with the specified key.
If the key does not exist, insert the key, with the specified value.
dictionary.setdefault(keyname, value)
keyname : Required. The keyname of the item you want to return the value from
value : Optional.
If the key exist, this parameter has no effect.
If the key does not exist, this value becomes the key’s value.
Default value None.
References
w3schools