what does yield function do? what is the difference between return and yield?
Answer / siva kumar reddy dandu
Yield function keeps all single return values and return all at a time as a list
Yield and return both are used for returning the values from function.
Generally yield is used with iterators, So yield will keep all the return values of each iterative call and returns final result at the end of call as List where as return can return one value for each function call.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is none literal in python?
Why is that none of my threads are not running? How can I make it work?
Mention the concept used in python for memory managing
What is gil in python?
What is nose python?
What is matplotlib for python?
What are pandas in python?
What is class used for in python?
Does python interact with database?
How do I know my python version?
What is __init__?
What are python namespaces?