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 string mutable?
Can I build website using python?
Can you explain this why are we getting an error here?
What are the built-in data-types in python?
Is python shell scripting?
Have you heard of the yield keyword in python?
What is dogpile effect?
What is difference between input and raw_input in python?
Should I learn r or python first?
Can you write an efficient code to count the number of capital letters in a file?
Explain me five benefits of using python?
Define flask in python?