-
Mastering Python Standard Library: infinite iterators of itertools
Let’s continue our little research of
itertools
module.Today we’ll have a look at 3 infinite iterator constructors:
-
Mastering Python Standard Library: itertools.chain
Imagine, you need to iterate over some N iterables.
For example, you have two lists: l1 and l2.
Here is the easiest way to do so:
-
Tricky Unpacking In Python
Imagine, you iterate through a collection, which contains some other collections.
Like so: list of lists
One obvious way to iterate over inner values is to use indexing: