The itertools module is a collection of tools intended to be fast and use memory efficiently when handling iterators (like lists or dictionaries). From the Python 3 documentation The module ...