sum_digits

typhon.math.sum_digits(n)[source]

Calculate the sum of digits.

Parameters:

n (int) – Number.

Returns:

Sum of digitis of n.

Return type:

int

Examples

>>> sum_digits(42)
6