Practice Makes Perfect Python
When I run my code into the console, it runs perfectly but the editor keeps giving me this error message:
"Oops, try again. Your function fails on digit_sum(434). It returns 22 when it should return 11"
a =  def digit_sum(n): n = str(n) total = 0 for letter in n: a.append(int(letter)) for number in a: total += number return total