Which of the following statements is true about dictionaries in Python ?
Which of the following statements is true about dictionaries in Python ?
Options
Official answer
Option B — 'A dictionary cannot have two elements with same key' is the true statement, because dictionary keys must always be unique; if a key is repeated during creation, the later value simply overwrites the earlier one.
Marking scheme
- 1.1 mark: for correctly selecting option B.
Hint
Dictionary KEYS must be unique; values and key=value combinations have no such restriction.
Quick oral answer
A dictionary cannot have two elements with the same key because keys must be unique; if repeated during creation, the last value overwrites the earlier one, but values and even key=value pairs can repeat freely.
Common mistakes
- 1.Believing a dictionary is a sequence type because it can be looped over — it is a mapping type, accessed by key not position.
- 2.Assuming values in a dictionary must also be unique, like keys.
Analysis and explanation
This question checks the fundamental rules that govern Python dictionaries as a mapping (not sequence) data type.
Concept
- A dictionary is a mapping type that stores data as key-value pairs; keys must be unique and hashable (immutable), but values can repeat freely.
Why option B is correct
- If you try to define two entries with the same key, e.g.,
{'a':1, 'a':2}, Python does not raise an error — it silently keeps only the LAST value, proving that duplicate keys cannot coexist as separate elements.
Why other options are wrong
- Option A — a dictionary is a mapping type, not a sequence type (lists, tuples, strings are sequence types with positional/index-based access); dictionaries are accessed by key, not position.
- Option C — values in a dictionary CAN repeat, e.g.,
{'a':1, 'b':1}is perfectly valid, since only keys must be unique. - Option D — a key and its value CAN be identical, e.g.,
{'a':'a'}or{5:5}is valid Python.
Exam trap
- Students often assume dictionaries are sequence types because they can be iterated over, but 'sequence' in Python specifically means ordered, index-accessible types like list/tuple/string.
Interesting facts
Since Python 3.7, dictionaries officially guarantee insertion order is preserved — but this does not make them a 'sequence' type in the formal sense used for indexing/slicing.
Dictionary keys must be hashable (immutable), which is why lists cannot be used as dictionary keys but tuples can.
Question details
Q7 of 48 questions
- Board
- CBSE
- Class
- Class 12
- Subject
- Computer Science
- Year
- 2026
- Section
- Section A
- Marks
- 1
- Type
- MCQ
- Chapter
- Review of Python Basics (Class XI Recap)
- Topic
- Dictionaries — Key Properties
- Bloom's level
- understand
- Syllabus topic
- Unit 1: Computational Thinking and Programming – 2 — Dictionaries: Keys, Values, and Uniqueness
- Author
- CBSE
- Reviewed by
- Padhantu Academic Team
Spotted a mistake or something unclear?
Tell us and we will fix it.
Frequently asked questions
What happens if I define a dictionary with a repeated key?
Python does not raise an error; it silently retains only the last key-value pair for that key, discarding the earlier one(s).
Can dictionary values be duplicated?
Yes, dictionary values have no uniqueness restriction — multiple keys can map to the exact same value.