10 XP challenge
Total a List
easy
Build it yourself · 6 min
1 Learn2 Predict3 Solve
TaskYour mission
Return the sum of all items in numbers. An empty list has sum 0. numbers contains 0 to 30 integers, each from -100 to 100.
Examples
| Input | Return |
|---|---|
numbers = [2,4,1]total: 0 → 2 → 6 → 7. The result is 7. | 7 |
numbers = [-3,5,-2]total: 0 → -3 → 2 → 0. The result is 0. | 0 |
Your code
Write your answer inside Solution, then use return to send it back.
Ln 1, Col 1
JavaScript
Try examples runs the public examples. Check my code checks your full answer and saves your completion.