The Python problem can be solved with `itertools.tee`[0]
from itertools import tee
squares_min, squares_max = tee(x * x for x in range(10))
print(min(squares_min))
print(max(squares_max))
[0] https://docs.python.org/3/library/itertools.html#itertools.t...