collections module

The standard library module of extra container types, including Counter, defaultdict, namedtuple and deque.

In more detail

namedtuple makes a lightweight record type whose fields have names as well as positions, and deque is a list optimised for adding and removing at both ends. Counter and defaultdict are the two you will use most.

Related terms

Taught in

References