1. Settings with defaults
Write code Easy ✓ CompletedComplete with_defaults(settings, defaults). It must return a new dictionary that contains every default, with the user's settings overriding any default that has the same key. Neither argument may be changed.
def with_defaults(settings, defaults):
# return a NEW dict: all defaults, overridden by settings
pass
print(with_defaults({"theme": "dark"}, {"theme": "light", "font": 14}))
def with_defaults(settings, defaults):
return defaults | settings
print(with_defaults({"theme": "dark"}, {"theme": "light", "font": 14}))