Open Skylion007 opened 1 year ago
Explain briefly why you think this makes the code simpler.
# Bad a = {"key": "value"} if "key" not in a: a["key"] = "default_value" # Good a = {"key": "value"} a.set_default("key", "default_value")
Faster, more efficient, removes an if statement.
Explanation
Explain briefly why you think this makes the code simpler.
Example
Faster, more efficient, removes an if statement.