Vidyalelo
Python · Q74

MCQs for Python Dictionaries: Exam

Programming · Python · question 74

Q74

What will be the output of the following Python code snippet? a= a['a']=1 a['b']=[2,3,4] print(a)

A.
Exception is thrown
B.
{'b': [2], 'a': 1}
C.
{'b': [2], 'a': [3]}
D.
{'b': [2, 3, 4], 'a': 1}
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board