📅  最后修改于: 2022-03-11 14:46:05.440000             🧑  作者: Mango
>>> def get_squares():
... yield from (num ** 2 for num in range(10))
...
>>> list(get_squares())
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]