Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Python-Quizzes | Python Dictionary Quiz | Question 22

  • Last Updated : 17 Sep, 2020

Question 22:Find the output of the following program:

a ={} 
a['a']= 1
a['b']=[2, 3, 4

(A) {‘b’: [2], ‘a’: 1}
(B) {‘a’: 1, ‘b’: [2, 3, 4]}
(C) {‘b’: [2], ‘a’: [3]}
(D) Error

Answer: (B)

Explanation: Mutable members can be used as the values of the dictionary but they cannot be used as the keys of the dictionary

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!