Sum of Digits

Sum of Digits

The task in this mission is as follows:

You are given an integer. If it consists of one digit, simply return its value. If it consists of two or more digits - add them until the number contains only one digit and return it.

Input: Integer (int).

Output: Integer (int).

Examples:

assert sum_digits(38) == 2
assert sum_digits(0) == 0
assert sum_digits(10) == 1
assert sum_digits(132) == 6