At Westonci.ca, we make it easy to get the answers you need from a community of informed and experienced contributors. Get immediate and reliable answers to your questions from a community of experienced experts on our platform. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently.

What is the usage of "yield" in python?

Sagot :

Answer:

Yield is a keyword in Python that is used to return from a function without destroying the states of its local variable and when the function is called, the execution starts from the last yield statement. Any function that contains a yield keyword is termed a generator. Hence, yield is what makes a generator.

Explanation: