diff --git a/kyu_7/factorial/factorial.py b/kyu_7/factorial/factorial.py index ab932991f50..0e36e94d631 100644 --- a/kyu_7/factorial/factorial.py +++ b/kyu_7/factorial/factorial.py @@ -1,6 +1,8 @@ -# Created by Egor Kostan. -# GitHub: https://github.com/ikostan -# LinkedIn: https://www.linkedin.com/in/egor-kostan/ +""" +Solution for -> Sum of Numbers +Created by Egor Kostan. +GitHub: https://github.com/ikostan +""" def factorial(n: int) -> int: @@ -11,12 +13,12 @@ def factorial(n: int) -> int: :param n: :return: """ - if n < 0 or n > 12: raise ValueError('Invalid input: {}'.format(n)) - result = 1 + result: int = 1 while n > 0: result *= n n -= 1 + return result diff --git a/kyu_7/factorial/test_factorial.py b/kyu_7/factorial/test_factorial.py index 3d3f13e9302..77b43204b0b 100644 --- a/kyu_7/factorial/test_factorial.py +++ b/kyu_7/factorial/test_factorial.py @@ -1,6 +1,8 @@ -# Created by Egor Kostan. -# GitHub: https://github.com/ikostan -# LinkedIn: https://www.linkedin.com/in/egor-kostan/ +""" +Test for -> Sum of Numbers +Created by Egor Kostan. +GitHub: https://github.com/ikostan +""" # FUNDAMENTALS ALGORITHMS NUMBERS @@ -38,24 +40,25 @@ def test_factorial(self): ValueError (Python). :return: """ - + # pylint: disable-msg=R0801 allure.dynamic.title("Testing 'factorial' function") allure.dynamic.severity(allure.severity_level.NORMAL) - allure.dynamic.description_html('