Hi, can someone tell me what is wrong here? It seems that the code works correctly and performs the condition, but for some reason it does not pass the check. Who has any ideas? Thanks a lot.
Oops, try again. Your function fails on digit_sum(434). It returns 12 when it should return 11.
count = 0 numbers =  def digit_sum(n): if n >= 0: n = str(n) for i in range(len(n)): numbers.insert(i, int(n[i])) count = sum(numbers) return count else: print "You entered an invalid value!" print digit_sum(12345) print digit_sum(12345)