Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what does yield function do? what is the difference between return and yield?



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

Post New Answer

More Python Interview Questions

Explain python’s parameter-passing mechanism?

0 Answers  


How do we share global variables across modules in Python?

1 Answers  


What is the difference between a list and a tuple?

0 Answers  


Which is faster c++ or python?

0 Answers  


What are the differences between del keyword and clear() function?

0 Answers  


What happens if an error occurs that is not handled in the except block?

0 Answers  


What do (lambda) function closures capture in python?

0 Answers  


Define the support for apex that exists?

0 Answers  


What is range and xrange in python?

0 Answers  


Explain how you can access sessions in flask?

0 Answers  


Which linux is best for python programming?

0 Answers  


Why should I learn python in 2019?

0 Answers  


Categories