0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
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. For example:
number_sum(5) -> 1+2+3+4+5 -> 15
number_sum(3) -> 1+2+3 -> 6
Remember that a range
is not inclusive of the last number.
Focus Editor
Alt+Shift+]
Next Tab
Alt+Shift+[
Become a member to Submit
Become a member to Run
Become a member to view solution