Programming-Idioms

History of Idiom 54 > diff from v6 to v7

Edit summary for version 7 :

Version 6

2015-08-20, 16:26:21

Version 7

2015-08-21, 23:26:30

Idiom #54 Compute sum of integers

Calculate the sum s of integer list x.

Idiom #54 Compute sum of integers

Calculate the sum s of integer list x.

Code
s = sum(x)
Code
s = sum(x)
Comments bubble
sum is a built-in function.
Comments bubble
sum is a built-in function.
Doc URL
https://docs.python.org/2/library/functions.html#sum
Origin
https://docs.python.org/2/library/functions.html#sum