+ 10
I still couldn't understand the difference between using the return and yield statement. Could someone explain?
3 Antworten
+ 14
Return is one time only. Yield works like a series of return statements, inside a generator.
+ 5
I see so yield works same as return but just keeps returning values more than one time did I get it right?
+ 2
yes. if used with a loop calling it. if you call a generator once, the yield = return.