On 2010-03-24 14:07:24 -0700, Steven D'Aprano <ste...@remove.this.cybersource.com.au> said:
On Wed, 24 Mar 2010 15:29:07 +0000, kj wrote:

Is there a sequence-oriented equivalent to the sum built-in?  E.g.:

seq_sum(((1, 2), (5, 6))) --> (1, 2) + (5, 6) --> (1, 2, 5, 6)

?

Yes, sum.

help(sum) is your friend.

You might not want to be so glib. The sum doc sure doesn't sound like it should work on lists.

   Returns the sum of a sequence of numbers (NOT strings) plus the value
   of parameter 'start' (which defaults to 0).

-Tom

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to