Combinations and recursion, from an ASPN snippet

dromedary camel at
Thu Mar 20 03:39:05 CET 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.


More information about the Python-list mailing list