Sum of digits
Write digit_sum(n) that returns the sum of the decimal digits of a non-negative integer.
Examples
digit_sum(1234) → 10 digit_sum(0) → 0
Exercise
3 checksSum of digits
def digit_sum(n):
...
print(digit_sum(1234))
Press Run to try your code, then Check answer to grade it.