A Look at Python Generators



 .


A Look at Python Generators
November 16, 2020Topics:
Languages



Generators are functions that return an iterable set of items that can be iterated through one at a time. They were introduced with Python Enhancement Proposal 255 (PEP 255). Python Enhancement Proposal 255 is a design document that provides information to the Python developer community describing the concept of generators in Python.

Python generators are objects that can be looped over similar to that of a list. Unlike lists, lazy iterator contents are not stored in the memory. The efficient way to iterate through large datasets is through the use of generators.

.

https://www.section.io/engineering-education/python-generators/

.

https://replit.com/@paulodhiambo/PythonGenerators#main.py

.

Post a Comment

0 Comments