Python Programming - Dictionaries - Discussion
Discussion Forum : Dictionaries - General Questions (Q.No. 23)
23.
How do you remove a key-value pair from a dictionary in Python without raising an error if the key is not present?
Answer: Option
Explanation:
The
pop()
method with a default value of None
removes a key-value pair from a dictionary without raising an error if the key is not present.
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