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 |
Is python is easy?
Explain about indexing and slicing operation in sequences?
What are the components of python memory manager?
Is python good for coding?
What does sorted do in python?
what is random module will do in python and what are the functions we can apply on random module
Which is best python or r?
How would you display a file’s contents in reversed order?
In oops what is a diamond problem in inheritance?
Are methods and constructors the same thing?
Is python the future of programming?
Explain a few methods to implement functionally oriented programming in python?