Learning Python Generators
38mIntermediate2022-05-24
Authors

Megan Amendola
Software Development Instructor
Course details
Generators are a concept unique to Python. They're incredibly helpful if you know how and when to use them. Simply put, generators are possibly the best way to iterate through large and complex data sets. In this course, Megan Amendola covers the basics you need to know about Python generators, starting from what they are, how to create them, what they’re for, and ways to use them. Megan teaches you the benefit of using Python generators to improve your program’s performance and save memory when working with large data sets using generator functions. She also covers what Python’s yield keyword is and what it does, how to create a generator expression, how to combine multiple generators into a pipeline, and more. Megan also provides challenges and solutions as you go along so you can test your knowledge as you learn.
Skills covered
PythonLearningProgramming LanguagesOpen SourceSoftware Development
Concepts
0. Introduction
- 01 - About the Python generators
- 02 - Previous knowledge
- 03 - Project files
1. Understanding Generator Functions
- 04 - What are Python generators
- 05 - Generator functions
- 06 - Interacting with the generator object
- 07 - Generators and memory
- 08 - Challenge - Squaring numbers
- 09 - Solution - Squaring numbers
2. Generator Expressions
- 10 - Reviewing Python comprehensions
- 11 - Generator expressions
- 12 - Working with expressions
- 13 - Comprehensions vs. expressions
- 14 - Challenge - Most words
- 15 - Solution - Most words
3. Generator Pipelines
- 16 - What is a pipeline
- 17 - Challenge - Counting characters
- 18 - Solution - Counting characters
4. Practice Python Generators
- 19 - Challenge - Weather data
- 20 - Solution - Weather data
Conclusion
- 21 - Next steps
Related courses
- Learning Python
- Learning Python (2021)
- Learning Python with PyCharm
- Python for Non-Programmers
- Deep Learning with Python: Hands-On Introduction to Deep Learning Models
- Deep Learning with Python: Sequence Models and Transformers
- Python Code Challenges for Object-Oriented Programming
- AI for Telecom: Network Optimization and Security in 5G/Edge Systems