28.02.18 00:27, Chris Angelico пише:
Example usage
=============
These list comprehensions are all approximately equivalent::
# Calling the function twice
stuff = [[f(x), f(x)] for x in range(5)]
Other options:
stuff = [[y, y] for y in (f(x) for x in range(5))]