Solve Problems by Coding Solutions - A Complete solution for python programming
import math
def digSum( n):
sum = 0
while(n > 0 or sum > 9):
if(n == 0):
n = sum
sum += n % 10
n /= 10
return sum
n = 1234
print (digSum(n))
Post a Comment
No comments:
Post a Comment