Create 3 - Digital Sum.py

This commit is contained in:
Lukas Baumann 2021-02-17 12:49:28 +01:00 committed by GitHub
parent 808ac8a0f5
commit 9b21cea8b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

5
16/3 - Digital Sum.py Normal file
View File

@ -0,0 +1,5 @@
def digitalSum(n):
if n < 10:
return n
else:
return digitalSum(n//10) + n%10