3 ms·
> However, it is also possible - in contrast to generators - to iterate over those multiple times if needed, it is aonly not so efficient. You can reuse a gene
by wting 12y ago
> However, it is also possible - in contrast to generators - to iterate over those multiple times if needed, it is aonly not so efficient.
You can reuse a generator multiple times via itertools.tee():
https://docs.python.org/2/library/itertools.html#itertools.tee https://docs.python.org/2/library/itertools.html#itertools.t...