google, Python, and eleven (was Re: google and Python ;-)

Andrew Dalke dalke at dalkescientific.com
Sat Sep 22 20:48:15 EDT 2001


Peter Hansen wrote:
>>>> def numerology(s):
>...     f = lambda x, y : x+y
>...     return reduce(f, map(int, str(reduce(f, map(ord, s)))))

Instead of making a new lambda function, use operator.add.

 :)

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list