Python Programming - Dictionaries - Discussion
Discussion Forum : Dictionaries - General Questions (Q.No. 3)
3.
What is the purpose of the
dictionary.setdefault(key, default_value)
method?
Answer: Option
Explanation:
The
setdefault()
method sets the default value for a key if the key is not present in the dictionary.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers