kyu_6.sum_of_digits_digital_root package¶
Submodules¶
kyu_6.sum_of_digits_digital_root.digital_root module¶
-
kyu_6.sum_of_digits_digital_root.digital_root.
digital_root
(n: int) → int[source]¶ In this kata, you must create a digital root function.
A digital root is the recursive sum of all the digits in a number. Given n, take the sum of the digits of n. If that value has more than one digit, continue reducing in this way until a single-digit number is produced. This is only applicable to the natural numbers. :param n: :return:
kyu_6.sum_of_digits_digital_root.test_digital_root module¶
-
class
kyu_6.sum_of_digits_digital_root.test_digital_root.
DigitalRootTestCase
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Testing digital_root function
-
test_digital_root
()[source]¶ In this kata, you must create a digital root function.
A digital root is the recursive sum of all the digits in a number. Given n, take the sum of the digits of n. If that value has more than one digit, continue reducing in this way until a single-digit number is produced. This is only applicable to the natural numbers. :return:
-