error:Oops, try again. Your function fails on digit_sum(434). It returns None when it should return 11.
So I figured to turn n into a str, and the hint reminded me I had to turn the characters of the string back to int. Can smn tell me why this doesnt work?
def digit_sum(n): string_num=str(n) totalsum=0 for c in string_num: totalsum+=int(c)