Create 3 - Digital Sum.py
This commit is contained in:
parent
808ac8a0f5
commit
9b21cea8b6
5
16/3 - Digital Sum.py
Normal file
5
16/3 - Digital Sum.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
def digitalSum(n):
|
||||||
|
if n < 10:
|
||||||
|
return n
|
||||||
|
else:
|
||||||
|
return digitalSum(n//10) + n%10
|
Loading…
Reference in New Issue
Block a user