max(), sum(), next()

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sat Sep 6 09:49:27 CEST 2008


On Sat, 06 Sep 2008 00:33:25 -0400, Manu Hack wrote:

> Actually it's even more natural to state sum([x]) = x, and this way you
> can never conclude that sum([]) = 0 from there.

But what you can say is that for any list L, sum(L) = sum(L + [0]).

Therefore sum([]) = sum([] +[0]) = 0



-- 
Steven



More information about the Python-list mailing list