Basics of Python Generators

Understanding the basics of generators and implementing them in Python

Muriel Kosaka
Towards Data Science
4 min readFeb 8, 2021

--

Photo by Boitumelo Phetla on Unsplash

What are Python Generators?

Python Generator functions allow you to declare a function that behaves likes an iterator, allowing programmers to make an iterator in a fast, easy, and clean way. An iterator is an object that can be iterated or looped upon. It…

--

--