Collection Modules

collections

Specialized containers for counting, layered lookups, double-ended queues and records with named fields. Choose the container that matches the required access pattern.

Formal Syntax & Structure

python syntaxpython
collections

Return Value

module

Module object available through import.

Working Example

Example Snippetpython
import collectionsprint(collections.Counter("aba").most_common(1))
Python Reference