sum for sequences?

kj no.email at please.post
Wed Mar 24 11:29:07 EDT 2010



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)

?

(By "sequence" I'm referring primarily to lists and tuples, and
excluding strings, since for these there is ''.join()).

TIA!

~K



More information about the Python-list mailing list