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 a coverage report?
How will you merge two dictionaries in python?
How do you use super in python?
What is speech_recognition? Does this ship with python by default?
What is the dogpile effect?
How to find bugs or perform static analysis in a python application?
What is variable length argument in function?
Explain how to redirect the output of a python script from standout(ie., A monitor) on to a file?
Explain the use of the split function in python?
How do you reload a python module?
How can I execute arbitrary python statements from c?
Tell me what is pep 8?