Generators and Generator Expressions

Learning PathSkills: Python, Iterators, Iterables, Itertools, Asynchronous Iterations, Generators, Yield

A person looking at a large machine that promintently shows the Python yield keyword

Enhance your Python skills with our focused learning path. Understand iterators and iterables, leverage itertools, explore asynchronous iterations, and master generators and yield. Boost your code efficiency and clarity.

Generators and Generator Expressions

Learning Path ⋅ 4 Resources

Title image for Efficient Iterations With Python Iterators and Iterables (Iterators and Iterables in Python: Run Efficient Iterations)

Course

Efficient Iterations With Python Iterators and Iterables

Learn what iterators and iterables are in Python. You'll learn how they differ and when to use them in your code. You'll also learn how to create your own iterators and iterables to make data processing more efficient.

Title image for Python itertools By Example (Python Itertools)

Tutorial

Python itertools By Example

Master Python's itertools module by constructing practical examples. You'll start out simple and then gradually tackle more complex challenges, encouraging you to "think iteratively."

Title image for Asynchronous Iterators and Iterables in Python (Asynchronous Iterators and Iterables in Python)

Tutorial

Asynchronous Iterators and Iterables in Python

Learn how to create and use asynchronous iterators and iterables in Python. You'll explore their syntax and structure and discover how they can be leveraged to handle asynchronous operations more efficiently.

Title image for Python Generators 101 (How to Use Generators and Yield in Python)

Course

Python Generators 101

Learn about generators and yielding in Python. You'll create generator functions and generator expressions using multiple Python yield statements. You'll also learn how to build data pipelines that take advantage of these Pythonic tools.

Got feedback on this learning path?

Looking for real-time conversation? Visit the Real Python Community Chat or join the next “Office Hours” Live Q&A Session. Happy Pythoning!

« Browse All Learning Paths