- Home
- Class - 12 CBSE Computer Science — Assertion Reason Type Questions
Assertion. Dictionaries are mutable, hence
Class - 12 CBSE Computer Science — Assertion Reason Type Questions
Assertion. Dictionaries are mutable, hence its keys can be easily changed.
Reason. Mutability means a value can be changed in place without having to create new storage for the changed value.
Answer
(d)
Assertion is false but Reason is true.
Explanation
Dictionaries are indexed by keys and each key must be immutable and unique. However, the dictionary itself is mutable, meaning that we can add, remove, or modify key-value pairs within the dictionary without changing the identity of the dictionary object itself. Mutability refers to the ability to change a value in place without creating a new storage location for the changed value.