1def gen(): 2 print("sent:", (yield 1)) 3 yield 2 4 5def gen2(): 6 print((yield from gen())) 7 8g = gen2() 9next(g) 10print("yielded:", g.send("val")) 11try: 12 next(g) 13except StopIteration: 14 print("StopIteration") 15