Favorite non-python language trick?

Steven D'Aprano steve at REMOVETHIScyber.com.au
Sat Jul 2 21:43:54 EDT 2005


On Fri, 01 Jul 2005 12:24:44 -0700, Devan L wrote:

> With the exception of reduce(lambda x,y:x*y, sequence), reduce can be
> replaced with sum, and Guido wants to add a product function.

How do you replace:

reduce(lambda x,y: x*y-1/y, sequence) 

with sum?


Inquiring minds want to know.


-- 
Steven.




More information about the Python-list mailing list