We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.


sum(sequence[, start=0])

Sums start and the items of a sequence, from left to right, and returns the total. start defaults to 0. The items are normally numbers, and are not allowed to be strings. The fast, correct way to concatenate sequence of strings is by calling ''.join(sequence). Note that sum(range(n), m) is equivalent to reduce(operator.add, range(n), m). New in version 2.3.