What is <yield> keyword in python?



What is <yield> keyword in python?..

Answer / Pawan Pratap Singh

The `yield` keyword in Python is used in generators, which are iterable objects that can be traversed more than once. A generator can be created using the `def` keyword followed by a function with at least one `yield` statement.n```pythonndef my_generator():n yield 1n yield 2n yield 3n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How do you write a function in python 3?

1 Answers  


Can you write an efficient code to count the number of capital letters in a file?

1 Answers  


What is the best notepad?

0 Answers  


What is itemgetter in python?

1 Answers  


How you can minimize the memcached server outages in your python development?

1 Answers  


list some of the data science libraries in python

0 Answers  


How memory is managed in python?

1 Answers  


What does the continue do in python?

1 Answers  


Does python have a ternary conditional operator?

1 Answers  


Define the support for apex that exists?

1 Answers  


Do you know the number of keywords in python? Why should you know them all?

1 Answers  


How do you sort a list in ascending order in python?

1 Answers  


Categories