You can use a generator function to do this. (It's pretty idiomatic Python).
How to return values from For Loop via return in a function
How to return values from For Loop via return in a function
|
|
Users browsing this thread: 2 Guest(s)