kyu_6.sum_of_digits_digital_root package
Submodules
kyu_6.sum_of_digits_digital_root.digital_root module
Solution for -> Sum of Digits / Digital Root.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- 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
Test for -> Sum of Digits / Digital Root.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- class kyu_6.sum_of_digits_digital_root.test_digital_root.DigitalRootTestCase(methodName='runTest')[source]
Bases:
TestCaseTesting digital_root function.
- _classSetupFailed = False
- _class_cleanups = []
- test_digital_root = None
- test_digital_root_0(**kw)
In this kata, you must create a digital root function [with n=16, expected=7].
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:
- test_digital_root_1(**kw)
In this kata, you must create a digital root function [with n=456, expected=6].
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:
- test_digital_root_2(**kw)
In this kata, you must create a digital root function [with n=942, expected=6].
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:
- test_digital_root_3(**kw)
In this kata, you must create a digital root function [with n=132189, expected=6].
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:
- test_digital_root_4(**kw)
In this kata, you must create a digital root function [with n=493193, expected=2].
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:
Module contents
Sum of Digits / Digital Root.