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"}
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
Join The Discussion