Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
Write sum_to(n) that returns the sum 1 + 2 + … + n for an integer n that is at least 1. Use a loop.
Skills: return, accumulation in a function.