Description:
Find the sum of all digits in a number.
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