Examveda

What will be the output of the following Python code snippet?
a={1:"A",2:"B",3:"C"}
print(a.setdefault(3))

A. {1: 'A', 2: 'B', 3: 'C'}

B. C

C. {1: 3, 2: 3, 3: 3}

D. No method called setdefault() exists for dictionary

Answer: Option B


This Question Belongs to Python Program >> Dictionary In Python

Join The Discussion

Related Questions on Dictionary in Python