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

What do you think is the output of the following code fragment?

0 Answers  


Is python a programming?

0 Answers  


Explain about assert statement?

0 Answers  


What is the difference between local vs global in python?

0 Answers  


What is the python interactive console or python shell?

0 Answers  


Are there any interfaces to database packages in python?

0 Answers  


What is the best free ide for python?

0 Answers  


In Python, how do you remark numerous lines?

3 Answers  


What is the result of pow(x,y)?

0 Answers  


Explain the database connection in python flask?

0 Answers  


Why is the order in python dictionaries and sets arbitrary?

0 Answers  


How can you randomize the items of a list in place in python?

0 Answers  


Categories