Laddar uppgiften…
Dictionaries are often used for settings: first you have default values, then user choices can override them. The function merge_dicts receives two dictionaries, a and b, and combines them into a new dictionary. If the same key appears in both dictionaries, use the value from b.
({"x": 1}, {"y": 2}){"x": 1, "y": 2}({"x": 1}, {"x": 5}){"x": 5}({}, {}){}def merge_dicts(a: dict, b: dict) -> dict:
Logga in för att se historik över inskick
Logga inLogga in för att använda AI-mentorn
Logga inThey run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.