as an asidesolving the preceding problem without using generator is tricky enough that this problem is common interview question if you answer it as shown like thisbe prepared for your interviewer to be both impressed and somewhat irritated that you answered it so easily they will likely demand that you explain exactly what is going on of coursearmed with the principles you've leaned in this you won' have any problem the yield from syntax is useful shortcut when writing chained generatorsbut it is more commonly used for different purposepiping data through coroutines we'll see many examples of this in concurrencybut for nowlet' discover what coroutine is coroutines coroutines are extremely powerful constructs that are often confused with generators many authors inappropriately describe coroutines as "generators with bit of extra syntax this is an easy mistake to makeasway back in python when coroutines were introducedthey were presented as "we added send method to the generator syntax this is further complicated by the fact that when you create coroutine in pythonthe object returned is generator the difference is actually lot more nuanced and will make more sense after you've seen few examples while coroutines in python are currently tightly coupled to the generator syntaxthey are only superficially related to the iterator protocol we have been discussing the upcoming (as this is publishedpython release makes coroutines truly standalone object and will provide new syntax to work with them the other thing to bear in mind is that coroutines are pretty hard to understand they are not used all that often in the wildand you could likely skip this section and happily develop in python for years without missing or even encountering them there are couple libraries that use coroutines extensively (mostly for concurrent or asynchronous programming)but they are normally written such that you can use coroutines without actually understanding how they workso if you get lost in this sectiondon' despair but you won' get losthaving studied the following examples here' one of the simplest possible coroutinesit allows us to keep running tally that can be increased by arbitrary valuesdef tally()score