Python Yield Keyword?? 2MinutesPy

preview_player
Показать описание
#yield #yieldkeyword #python #pythonprogramming #2minutespy

🖐Hey, want to know about yield in Python?

🐍In this beginner-friendly video, we'll explore Python "yield" keyword using simple and practical examples without technical jargon.

The yield keyword temporarily freezes the execution and returns the value to the caller. Because it freezes the execution, the function's state is retained, allowing it to continue from where it left off.

Chapters:
0:00 Python yield
0:27 Example
0:59 How execution proceeds in a function containing yield
1:25 Visualizing execution flow

More 2 Minutes Python Tutorial:

@2MinutesPy
Рекомендации по теме
Комментарии
Автор

As usual, I learn the 'yield` keyword in less than 2 min. Good explanation.

zd
Автор

Nice one, I liked how you explained the execution process👍

dweepverma
Автор

Nice, can its usecase can be in generating sequences to maintain some load version of a dataframe/table etc?

adityamathur
Автор

I've seen this be used for integration tests in Python code based. Thanks for the explanation

OtterSwims
Автор

good
edit: time to generate generator that generate stuff

compositeboson