Write a program that prints the sum of the numbers from 1 to n.
Implement sum_1_to_n(n), which accepts a non-negative integer n and returns the sum from 1 through n. The caller is responsible for printing the returned value.
Constraints
0 <= n <= 10^9
n is an integer
Return an integer result
Function Signature
defsum_1_to_n(n):
Interviewer
Your question is Coding: Sum of N Numbers. Start with the requirements in the Question tab.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.