logo CodeStepByStep logo

sum_up_to

Language/Type: Python cumulative algorithms

Write a function named sum_up_to function that accepts an integer parameter n and returns the sum of the integers from 1 through n inclusive. For example, sum_up_to(5) returns 1 + 2 + 3 + 4 + 5 or 15. You may assume that the value of n is at least 1.

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.