def test_gen():
value = yield
end = value + 20
while True:
if value > end:
break
yield value
value += 1
mygen = test_gen()
next(mygen)
mygen.send(10)
for item in mygen:
print(item)
mygen = test_gen()
next(mygen)
print('Send:', mygen.send(10))