Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Create a function that returns the sum of a list of numbers.
- On line 3, define a function called total that accepts one argument called numbers. It will be a list.
- Inside the function, create a variable called result and set it to zero.
- Using one of the two methods above, iterate through the numbers list. For each number, add it to result.
- Finally, return result.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement