Vidyalelo
Python · Q50

MCQs for Python Dictionaries: Exam

Programming · Python · question 50

Q50

What will be the output of the following Python code? >>> import collections >>> a=dict() >>> a=collections.defaultdict(str) >>> a['A']

A.
An exception is thrown since the dictionary is empty
B.
' '
Answer
C.
'A'
D.
0

Answer: Option B

Solution

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