Skip to content
>_
LearnPy Hub
☰ Menu
Learn
Practice
Compiler
Arena
Contest
About
◐
← 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
☀ Light
Clear
▶ Run
▶ Run samples
Submit
Output appears here
Recursive Sum · Python practice problem · LearnPy Hub