Oct 15, 2021
Python Itertools
Python itertools module provides a set of iterator blocks that can be used to combine iterators into a new iterator which will apply some modifications during the iteration of the sequences. For example building blocks like cycle allows infinitely cycling through a sequence, another example is groupby which provides a new iterator giving the groups on each iteration. In today’s post, we will look at some of the functions provided by itertools with examples.