Last reviewed
Correct answer: C. Looking up values by a meaningful key rather than a numeric position
Explanation
A dictionary answers "what is the value stored under this name?" without searching for it. The tutorial draws the contrast directly: "Unlike sequences, which are indexed by a range of numbers, dictionaries are indexed by keys, which can be any immutable type". The glossary calls it "An associative array, where arbitrary keys are mapped to values." Swap a list plus a linear scan for a dictionary lookup and the scan disappears — the cost of finding a user by id stops growing with the number of users.
Two details will save you an afternoon. Keys must be hashable, since "A mapping object maps hashable values to arbitrary objects" — a string, a number or a tuple qualifies, a list does not. And one key holds exactly one value: assigning to a key that already exists overwrites it silently, which is how a dictionary built inside a loop quietly loses earlier entries.
The other options miss what the type is for. A plain variable stores a single unstructured value, keys are unique rather than duplicated, and arithmetic belongs to operators and modules, not to the container.
Sources
“Unlike sequences, which are indexed by a range of numbers, dictionaries are indexed by keys, which can be any immutable type”
“A mapping object maps hashable values to arbitrary objects.”
“An associative array, where arbitrary keys are mapped to values.”
Practise 3 questions on this topic
Take Python Data Structures — Timed Test (3 questions) — scored instantly, explanation for every question, no login.