csc-python-solutions/16/4 - Digital Root.py

6 lines
96 B
Python
Raw Normal View History

2021-02-17 11:53:29 +00:00
def digitalRoot(n):
if n<10:
return n
else:
return digitalRoot(digitalSum(n))