generators

Tutorials on Python generators and the yield keyword for producing values one at a time.

Python: Generators with yield, Expressions, Pipelines

Learn the python generator yield pattern. A python generator is a function that produces values lazily with yield. Understand generator expressions, pipelines, send(), and why generators use almost no memory compared to lists. “Make it work, make it right, make it fast. In that order.” Kent Beck, Extreme Programming Last Updated: July 2026 | Tested on: Python 3.14.6 | Difficulty: Intermediate | Reading Time: 16 minutes Think of a Netflix show. You do not download the whole season before you ... Read More

Python: Higher-Order Functions, map(), filter(), reduce()

Transform a list, throw out the bad rows, total what is left: most data work is those three moves on repeat. The Python map filter reduce trio handles each move in a single line by taking your function as an argument. This post covers all three with tested examples, and is honest about when a plain list comprehension reads better. “A function that takes a function is just a recipe that takes another recipe as one of its ingredients.” Common ... Read More