Write a function that adds the digits of an integer. For example, the input receives a number: 10023. The result should be - 6 (1 + 0 + 0 + 2 + 3).
def digit_sum(number: int) -> int:
return(sum([int(num) for num in str(abs(number))]))
from unittest import TestCase
from solution import digit_sum
import codewars_test as test
from solution import digit_sum
@test.describe('Tests')
def tests():
@test.it('Test Cases')
def test_sums():
test.assert_equals(digit_sum(10000000000000000000000000000),1)
test.assert_equals(digit_sum(55001),11)
test.assert_equals(digit_sum(104),5)
test.assert_equals(digit_sum(0),0)
test.assert_equals(digit_sum(-1204),7)