- Built-in module to implement specialised container datatypes.
List of Module
- DefaultDict
- OrderedDict
- Counter
- ChainMap
- NamedTuple
- Deque
- UserDict
- UserList
- UserString
DefaultDict :
Referenced form Geeks For Geeks
- subclass to the dictionary object in python
- provides default values to keys so as not to raise keyerror
- Syntax :
class collections.defaultdict(default_factory)
- very first argument of DefaultDict is
default_factory
- this is only a syntax, when I say its required to put a default factory argument, I mean put in anything that can be returned as a default value.