What is the output?
gen = (x**2 for x in range(3)) print(next(gen)) print(next(gen))
0 then 1
1 then 4
0 then 4
[0, 1, 4]