LearnPy Hub
← Recursion & Lambda problems
Medium

Recursive Digit Sum

Write a recursive function returning the sum of the digits of a non-negative integer.

Input

One integer ≥ 0.

Output

Digit sum.

Sample 1

Input
12345
Output
15

Sample 2

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