def y(): for i in range(5): if(i == 3): return yield i print list(y())
Standard input is empty
[0, 1, 2]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!