What error is raised when accessing a missing dict key with d[key] in Python?
Correct answer
C. KeyError
5 views
C. KeyError
5 views
Looking up a missing key with square brackets raises KeyError.
Asked in: Python Interview Dictionaries
https://docs.python.org/3/tutorial/datastructures.html#dictionariesNot sure why the answer is C? Ask here and get an explanation.