Examveda

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

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

B. None

C. Error

D. [1,3,6,10]

Answer: Option A


This Question Belongs to Python Program >> Dictionary In Python

Join The Discussion

Related Questions on Dictionary in Python