#sample solution
def digit_sum(n):
numConvertedToString = str(n)
sum = 0
for c in numConvertedToString:
sum = sum + int(c)
return sum
def digit_sum(n):
numConvertedToString = str(n)
sum = 0
for c in numConvertedToString:
sum = sum + int(c)
return sum
No comments:
Post a Comment