simple recursion help

Stephen Waterbury golux at
Sun Oct 24 06:55:58 CEST 2004

Hung Jung Lu wrote:
> ...  The functional version would be:
> strings = lambda Xs, k: reduce(lambda r, i: [p + x for p in r for x
> in Xs], range(k), [''])

Wow!  Grand prize for elegance.  :)

More information about the Python-list mailing list