What does yield do in Python?

Опубликовано: 18 Март 2022
на канале: Alfredo Deza
122
6

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.

Use the GitHub repository to follow along → https://github.com/alfredodeza/python...


00:00 Introduction
00:48 What is an iterable
01:21 An eager iterable function
02:05 Difference using yield
03:22 Generating infinite items


На этой странице сайта вы можете посмотреть видео онлайн What does yield do in Python? длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Alfredo Deza 18 Март 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 122 раз и оно понравилось 6 зрителям. Приятного просмотра!