August 2018
Intermediate to advanced
366 pages
10h 14m
English
The itertools.chain function is a very convenient one when you have to consume multiple iterables one after the other.
By default, it accepts those iterables as arguments, so we would have to do:
itertools.chain(values[0], values[1], values[2])
But, for convenience, itertools.chain.from_iterable will chain the entries contained in the provided argument instead of having to pass them explicitly one by one.