Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Create a function that returns the sum of a list of numbers.
  2.  
  3. On line 3, define a function called total that accepts one argument called numbers. It will be a list.
  4. Inside the function, create a variable called result and set it to zero.
  5. Using one of the two methods above, iterate through the numbers list. For each number, add it to result.
  6. Finally, return result.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement