AnswerBox
Python

Sum of Digits

Description:
Find the sum of all digits in a number.
Python Code
def sum_digits(n):
    return sum(int(d) for d in str(abs(n)))

print(sum_digits(12345))
Expected Output
15