6.3.24 Sum of elements of a list
The
sum
or
add
command adds the elements of a list or sequence of numbers.
sum
takes
L
, a list or sequence of numbers.
sum(
L
)
returns the sum of the elements of
L
.
Example
sum
(2,3,4,5,6)
20