Re: sum up numbers in a list

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry Reedy

    Re: sum up numbers in a list



    sharon kim wrote:
    is there a way to sum up all the numbers in a list?
    >>help(sum)
    sum(...)
    sum(iterable[, start]) -value

    Returns the sum of an iterable of numbers (NOT strings) plus the value
    of parameter 'start' (which defaults to 0). When the iterable is
    empty, returns start.
    >>L=[28,39,20,78490, 37373,22,2,33,4 ,5]
    >>sum(L)
    116016

Working...