Oops, try again. Your function fails on digit_sum(434). It returns None when it should return 11.
For integer 1234, returns 10, still says the above error
My code looks correct and does what I expect, however it still returns an error message. I have tested this for a bunch of other integers and the sums of the digits are correct, but still errors.
def digit_sum(n): string = str(n) lst =  for number in string: lst.append(number) count = 0 for i in lst: count += int(i) print count digit_sum(1234)