Skip to content
Code ReadingDigit Sum
Break the Code

Digit Sum

Write a number for which this function gives the wrong answer.
1def digit_sum(n):
2 total = 0
3 while n > 9:
4 total += n % 10
5 n = n // 10
6 return total