The quiz where the difficulty automagically adapts to the player's Python knowledge
This is a question page. You can use this page to bookmark a question. Start a new quiz!
Question #871
my_dict = {"a": 1, "b": 2}
if "c" not in my_dict:
my_dict["c"] = 4
if "b" not in my_dict:
my_dict["c"] = 4
print(my_dict)
As "b" is already a key of my_dict , only the pair "c": 4 is added. (stackoverflow.com/questions/42315072/python-update-a-key-...)
Question difficulty: 🔵🔵🔵🔵🔵