so in theorygenerators are types of coroutinesfunctions are types of coroutinesand there are coroutines that are neither functions nor generators that' simple enoughehso why does it feel more complicated in pythonin pythongenerators and coroutines are both constructed using syntax that looks like we are constructing function but the resulting object is not function at allit' totally different kind of object functions areof coursealso objects but they have different interfacefunctions are callable and return valuesgenerators have data pulled out using next()and coroutines have data pushed in using send case study one of the fields in which python is the most popular these days is data science let' implement basic machine learning algorithmmachine learning is huge topicbut the general idea is to make predictions or classifications about future data by using knowledge gained from past data uses of such algorithms aboundand data scientists are finding new ways to apply machine learning every day some important machine learning applications include computer vision (such as image classification or facial recognition)product recommendationidentifying spamand speech recognition we'll look at simpler problemgiven an rgb color definitionwhat name would humans identify that color asthere are more than million colors in the standard rgb color spaceand humans have come up with names for only fraction of them while there are thousands of names (some quite ridiculousjust go to any car dealership or makeup store)let' build classifier that attempts to divide the rgb space into the basic colorsred purple blue green yellow orange grey white pink