Vidyalelo
Python · Q2

MCQs for Python Dictionaries: Exam

Programming · Python · question 2

Q2

What method is used to check if a key exists in a dictionary, and if not, add it with a default value?

A.
setdefault()
Answer
B.
addkey()
C.
insert()
D.
newkey()

Answer: Option A

Solution

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