- Yield is a keyword that is used like return, except the function will return a generator.
-when you call the function, the code you have written in the function body does not run.
-It return the list object.
for i in list:
#First way to call function and print yield value
for i in x:
#second way to print yield value
1 4 9 16
-In this program, we have a list [1,2,3,4] inside the 'square()' function then we yield each item of the list so it return the list with the generator.