Sumario: | What does the Yield keyword do in Python? This video covers the basics so you can understand what yield is, what is a generator, and why is it different than any other iterable in Python A yield keyword makes a function a lazy iterable. Producing values one at a time. The function becomes a generator, so when called, the code will not execute. A generator is a function that uses the yield keyword. This function is an iterable that produces values one at a time, or does a lazy production of values. I'll use a Jupyter Notebook that you can use to follow along with practical examples that will show you what are some of the key differences and when or why you would use the yield keyword. In this video you will learn: What is an iterable and how is it different from using yield? What does yield do to a function? What is a Python generator Potential uses for a Python generator like infinite results Useful Resources GitHub repository with examples Build Python applications from scratch Try Azure for Free Introduction to Azure Databricks.
|