kyu_7.always_perfect package
Submodules
kyu_7.always_perfect.check_root module
Solution for -> Always perfect.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- kyu_7.always_perfect.check_root.check_root(string: str) str[source]
Check root.
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
Test for -> Always perfect.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- class kyu_7.always_perfect.test_check_root.CheckRootTestCase(methodName='runTest')[source]
Bases:
TestCaseTesting ‘check_root’ function.
- _classSetupFailed = False
- _class_cleanups = []
- test_check_root = None
- test_check_root_0_4_5_6_7(**kw)
Testing ‘check_root’ function with various test inputs [with string=’4,5,6,7’, expected=’841, 29’].
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:
- test_check_root_1_3_s_5_6(**kw)
Testing ‘check_root’ function with various test inputs [with string=’3,s,5,6’, expected=’incorrect input’].
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:
- test_check_root_2_11_13_14_15(**kw)
Testing ‘check_root’ function with various test inputs [with string=’11,13,14,15’, expected=’not consecutive’].
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:
- test_check_root_3_10_11_12_13_15(**kw)
Testing ‘check_root’ function with various test inputs [with string=’10,11,12,13,15’, expected=’incorrect input’].
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:
- test_check_root_4_10_11_12_13(**kw)
Testing ‘check_root’ function with various test inputs [with string=’10,11,12,13’, expected=’17161, 131’].
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:
- test_check_root_5__3_2_1_0(**kw)
Testing ‘check_root’ function with various test inputs [with string=’\*-3,-2,-1,0’, expected=’incorrect input’].
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:
Module contents
Always perfect.