+ 1
What does yield do?
2 Respostas
+ 6
yield keyword is used for generators. yield will return a value but will not exit the loop. thus, you can continuously return a value even if the loop is an infinite loop.
+ 3
with the help of yield we can create code that will require less memory for their execution I.e. for lower models of PC. As yield runs one at a time for particular sections.