

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Number Sum
incomplete
2: Find Min
incomplete
3: Remove Non-Integers
incomplete
4: Factorial
incomplete
5: Area Sum
incomplete
6: List Division
incomplete
7: Join Strings
incomplete
8: Unit Tests
incomplete
9: Fix a Failing Test
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
In this chapter we are going to hammer down the concepts we've learned by running through a bunch of practice problems without introducing any new concepts.
Complete the number_sum function. It should add up all the numbers from 1 to n and return the result. If n is less than 1, return 0. For example:
number_sum(5) -> 1+2+3+4+5 -> 15number_sum(3) -> 1+2+3 -> 6Remember that a range will not include the last number.