Fun with lambda and map

gbreed at cix.compulink.co.uk gbreed at cix.compulink.co.uk
Tue Jan 29 11:43:43 EST 2002


Drew Csillag wrote:

> #the screen of e
> print'e=%s'%(lambda x:'%s.%s'%(x[0],x[1:-1]))(str(reduce(lambda
> (a,b),y,z=10L**1835:(a+z/b,b*y),[[0L,1L]]+range(1,752))[0]))

That can be simplified

print'e=2.%s'%(str(reduce(lambda(a,b),y,z=10L**1835:(a+z/b,b*y),[[0L,1L]]+
range(1,752))[0]))[1:-1]


                           Graham



More information about the Python-list mailing list