Python includes several standard programming data structures, such as
set, as part of its built-in types. Many applications do not require other structures, but when they do, the standard library provides powerful and well-tested versions that are ready to use.
collections module includes implementations of several data structures that extend those found in other modules. For example,
Deque is a double-ended queue that allows the addition or removal of items from either end. The
defaultdict is a dictionary that responds with a default value if a key is missing, while
OrderedDict remembers the sequence in which items are added to it. And
namedtuple extends the normal
tuple to give each member ...