csc-python-solutions/16/3 - Digital Sum.py
2021-02-17 12:49:28 +01:00

6 lines
95 B
Python

def digitalSum(n):
if n < 10:
return n
else:
return digitalSum(n//10) + n%10