Is there a way to sum up a list of numbers faster than with a for-loop, perhaps in the Python library? Or is that something really only multi-threading / vector processing can do efficiently?
Edit: Just to clarify, it could be a list of any numbers, unsorted, just input from the user.
You can use sum() to sum the values of an array.
a = [1,9,12] print sum(a)
Yet another way to sum up a list with the loop time:
s = reduce(lambda x, y: x + y, l)