PCEP Functions, Tuples, Dictionaries and Exceptions • Set 4
PCEP Functions, Tuples, Dictionaries and Exceptions Practice Test 4 — 15 questions with explanations. Free, no signup.
A developer is working with a dictionary `d = {'a': 1, 'b': 2, 'c': 3}` and needs to retrieve the value associated with a key without causing a KeyError if the key is missing. Which two approaches correctly achieve this? (Choose two.)
Choose an answer to begin — your selection is scored in the full session.
15 questions · instant feedback and full explanations after every question.