On May 12, 4:25 am, Miguel Lopes <[email protected]> wrote:

Alternatively, instead of this:

>             result_list.append(a_str)
>
>    # Now you can return the list
>    return result_list

one could yield the values:

              yield(a_str)

and then whatever other code uses function "check()" can still iterate
over the generator as in:

for s in check():
    # Operate on s

Reply via email to