Hackbright Code Challenges

Sum List

Sum List

Whiteboard

Easier

Concepts

Math, Loops

Download

sum-list.zip

Solution

Sum List: Solution


Compute the sum of a list of numbers.

For example:

>>> sum_list([5, 3, 6, 2, 1])
17

We’ve written a file, sumlist.py, with a function, sum_list:

def sum_list(num_list):
    """Return the sum of all numbers in list."""

However, this is unimplemented.