Generators are a special kind of function that returns a lazy iterator. These are objects that you can loop over like a list. Unlike lists, lazy iterators do not store their data in memory. Before diving in generators, we need first to elaborate a bit on the iterators concept and the yield keyword. Iterators An iterator is…
Read more