Examveda

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: Option D


This Question Belongs to Python Program >> Dictionary In Python

Join The Discussion

Related Questions on Dictionary in Python