Quiz Question 1 of 5
Which of the following best explains why the encoding
dictionary does not allow duplicate keys, even if the associated values are different?
Choose the correct answer below:
-
A
Python dictionaries are designed for efficient key lookups, which requires each key to be unique.
-
B
The values associated with the keys would be overwritten, causing unexpected behavior.
-
C
Python automatically removes any duplicates during the creation of the dictionary.
-
D
Duplicate keys would result in Python throwing a
KeyError
when the dictionary is accessed.