4 - digit_sum


#1


def digit_sum(n):
num = str(n)
sum = 0
for i in num:
sum = sum + int(i)
return sum

print digit_sum(1234)


#2

What is your question? We need to know so we can help you the best we can.


#3

I'm sorry...anything problem...the code is correct ! Thank you.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.