fork download
  1. def generator(string):
  2. for letter in string:
  3. print(letter + '_')
  4. yield
  5.  
  6. g = generator('xyz')
  7. next(g)
  8. next(g)
  9. next(g)
Success #stdin #stdout 0.01s 27712KB
stdin
Standard input is empty
stdout
x_
y_
z_