I'm trying to get the value from return
when using yield
with it as shown below:
def test():
yield 'One'
yield 'Two'
yield 'Three'
return 'Four' # Here
for x in test():
print(x)
But, I couldn't get the value Four
from return
as shown below:
One
Two
Three
So, how can I get the value from return
when using yield
with it?