4. digit_sum



It says I did it correctly, but I'm not entirely sure. I had it print out the results and it gave me a series of numbers and letters.

I expected just the numbers

def digit_sum(n):
    for char in str_n:
        total= int(char)+total
    return total
print digit_sum


That's because you're calling the function but you're not inputting anything.

print digit_sum(input)


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