Python Programming - Dictionaries - Discussion
Discussion Forum : Dictionaries - General Questions (Q.No. 30)
30.
How do you check if a key exists in a dictionary and, if not, add a default value to it?
Answer: Option
Explanation:
The provided code checks if the key exists in the dictionary, and if not, adds the key with the specified default value.
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