Combinations and recursion, from an ASPN snippet
dromedary
camel at oasis.com
Wed Mar 19 21:39:05 EST 2003
> The statement:
>
> return printList(blist)
>
> will cause termination of the recursion because the *return* statement causes
> control to go back to the previous context. As printList() does not
> (explicitly) return anything, it in fact returns None, so both the
> Combinations() functions will return None, eventually, but this value is not
> used (Python allows you to politely ignore return values).
Aha! The return statement. I get it. Thanks for that and the rest of
the reply. Very helpful.
Jon
More information about the Python-list
mailing list