The yield keyword in Python /

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 generato...

Full description

Bibliographic Details
Main Authors: Deza, Alfredo (Author), Gift, Noah (Author)
Corporate Author: Safari, an O'Reilly Media Company
Format: eBook
Language:English
Published: Pragmatic AI Solutions, 2022.
Edition:1st edition
Subjects:
Online Access:Connect to this electronic resource
Description
Summary: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
Physical Description:1 online resource (1 video file, approximately 5 min.)
Format:Mode of access: World Wide Web.