What does the “yield” keyword do?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
53 views
What is the use of the yield keyword in Python, and what does it do?
by (550 points) | 53 views

1 Answer

0 like 0 dislike

To understand what yield does, you must understand what generators are. And before you can understand generators, you must understand iterables.

by (1.2k points)

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
asked Mar 25, 2019 by lhav
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
28,158 users