kyu_7.always_perfect package¶
Submodules¶
kyu_7.always_perfect.check_root module¶
-
kyu_7.always_perfect.check_root.
check_root
(string: str) → str[source]¶ A function which takes numbers separated by commas in string format and returns the number which is a perfect square and the square root of that number.
If string contains other characters than number or it has more or less than 4 numbers separated by comma function returns “incorrect input”.
If string contains 4 numbers but not consecutive it returns “not consecutive”. :param string: :return:
kyu_7.always_perfect.test_check_root module¶
-
class
kyu_7.always_perfect.test_check_root.
CheckRootTestCase
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Testing check_root function
-
test_check_root
()[source]¶ Testing check_root function with various test inputs
A function which takes numbers separated by commas in string format and returns the number which is a perfect square and the square root of that number.
If string contains other characters than number or it has more or less than 4 numbers separated by comma function returns “incorrect input”.
If string contains 4 numbers but not consecutive it returns “not consecutive”. :return:
-