<AptiCode/>

Question 439: What is the purpose of thedictionary.setdefault(key, default_value)method?

tcs
wipro
infosys
general
aptitude
dictionaries
python-programming

Thesetdefault()method sets the default value for a key if the key is not present in the dictionary.