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

Andrew Dalke dalke at dalkescientific.com
Sun Sep 23 02:48:15 CEST 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