Logo

Programming-Idioms

History of Idiom 54 > diff from v12 to v13

Edit summary for version 13 by :

Version 12

2015-09-04, 21:00:28

Version 13

2015-10-29, 14:05:14

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
Doc URL
https://docs.python.org/2/library/functions.html#sum