listcomprehension, add elements?

Boris Borcic bborcic at gmail.com
Mon Jun 23 05:39:44 EDT 2008


John Machin wrote:
> 
> Instead of sum(a + b for a, b in zip(foo, bar))
> why not use sum(foo) + sum(bar)
> ?

or even sum(foo+bar) as may apply.

Cheers, BB




More information about the Python-list mailing list