I don't understand why my code is coming up with an error...
digit_list =  def digit_sum(n): string = str(n) for num in string: num = int(num) digit_list.append(num) sum_list = sum(digit_list) return sum_list digit_sum(434)
It works fine when I print sum_list, but I get the error:
Your function fails on digit_sum(434). It returns 22 when it should return 11.
Even though it prints 11 when I try it.