LearnPy Hub
← Recursion & Lambda problems
Easy

Recursive Sum

Write a recursive function that returns 1 + 2 + ... + n.

Input

One integer n ≥ 0.

Output

The sum.

Sample 1

Input
10
Output
55

Sample 2

Input
0
Output
0
solution.py
Output appears here
Recursive Sum · Python practice problem · LearnPy Hub