Class - 12 CBSE Computer Science — Assertion Reason Type Questions
Assertion (A): Dictionaries in Python are mutable.
Reasoning (R): The data inside a dictionary is stored as the key:value pairs enclosed within the curly braces {}.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Python Dictionaries
2 Likes
Answer
Both A and R are true but R is not the correct explanation of A.
Explanation
In Python, dictionaries are mutable, which means we can modify the key-value pairs, add new pairs, or remove existing pairs after the dictionary is created. Dictionaries are created using curly braces {}, and keys are separated from their corresponding values by a colon (:). Each key-value pair is separated by commas (,) within the dictionary.
Answered By
1 Like