I’m trying to learn about generators, coroutines and async in Python in this tutorial. After modifying the coroutines code that he/she have added in that tutorial, I noticed something weird happening and I couldn’t understand why it’s happening.
def coro(string): hello = yield "Hello "+string yield hello c = coro("ABC") print(next(c)) print(c.send("World"))
When i tried this, it prints the following:
Hello WORLD World
Why is that? Why doesn’t it print
World ABC in the second line? Why just