Lists · Beginner · 40 XP · about 4 min
Write a function called sum_list(numbers) that returns the sum of all numbers in a list.
Challenge: Try to solve this without using Python's built-in sum() function!
sum_list([1, 2, 3, 4, 5]) # Returns 15 sum_list([10, -5, 3]) # Returns 8 sum_list([]) # Returns 0
Ready?
Accept the challenge to start writing. A small timer counts the time this page is in view.
Output appears here.