🔵 🔵 🔵


Primary

၊၊||၊|။

sum() ⚬ᵖʸ|Documentation|1st|20251021153714-00-⌔

Built-in Functions — Python 3 documentation#sum

sum(iterable,/, start=0)

Sums start and the items of an iterable from left to right and returns the total. The iterable ’s items are normally numbers, and the start value is not allowed to be a string.

For some use cases, there are good alternatives to sum(). The preferred, fast way to concatenate a sequence of strings is by calling ''.join(sequence). To add floating-point values with extended precision, see math.fsum(). To concatenate a series of iterables, consider using itertools.chain().

Changed in version 3.8: The start parameter can be specified as a keyword argument.

Changed in version 3.12: Summation of floats switched to an algorithm that gives higher accuracy and better commutativity on most builds.

Changed in version 3.14: Added specialization for summation of complexes, using same algorithm as for summation of floats.

Printed 2026-06-28.

(echo:: @ )

Link to original

Secondary

• • •