Recursive summation

Report a typo

Write a recursive function rec_sum() that takes some natural number n as its input and outputs the sum of first n natural numbers.

This problem is very similar to that of finding a factorial, so we are sure that you'll be able to get it right!

Sample Input 1:

1

Sample Output 1:

1
Write a program in Python 3
def rec_sum(n):
# write the insides here!
return
___

Create a free account to access the full topic