fork download
  1. def foo(value):
  2. while True:
  3. value = (yield value)
  4.  
  5. bar = foo(1)
  6. print(next(bar))
  7. print(next(bar))
  8. print(bar.send(2))
Success #stdin #stdout 0.02s 7348KB
stdin
Standard input is empty
stdout
1
None
2