I have implemented this approach below::
x_list =  def digit_sum(x): #treat x as a list x_string = str(x) for i, char in enumerate(x_string): x_list.append(int(char)) print x , x_list , sum(x_list) return sum(x_list) digit_sum(434)
given the above code, I correctly returned 11 but I have this error:
Oops, try again. Your function fails on digit_sum(434). It returns 22 when it should return 11
Would you know if this is a possible bug or I just made a real mistake? I run my code in jupyter and it runs as expected.