Yield statement

Can we say yield is like return, but unlike return the yield statement after returning the value it goes back to the function to continue further execution

Hello @occipitalcord_sam, yes 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. And if we use any function that contains a yield keyword is termed as a generator.
I hope it is clear to you. Pls, mark it as resolve if it is clear to you, else ask if there is anything that is not clear to you.
Thanks :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.