def temp(): for i in range(5): yield 2*i g = temp() l = list(g) print(l)
Standard input is empty
[0, 2, 4, 6, 8]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!