Python Programming - Standard Libraries - Discussion
Discussion Forum : Standard Libraries - General Questions (Q.No. 88)
88.
What is the purpose of the
collections.defaultdict
class?
Answer: Option
Explanation:
from collections import defaultdict
# Example usage of collections.defaultdict
default_dict = defaultdict(int)
default_dict['a'] += 1
default_dict['b'] += 2
print(default_dict)
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