Sum of a list
easyLists10 XP
Return the sum of the numbers in nums. An empty list sums to 0.
Examples
- Input: nums = [1, 2, 3, 4]Output: 10
- Input: nums = []Output: 0
Examples use JSON: true/false/null are True/False/None in Python.
Return the sum of the numbers in nums. An empty list sums to 0.
Examples use JSON: true/false/null are True/False/None in Python.
Run examples checks the examples above. Submit also runs 3 hidden tests.