From 50761aa113b9c5b2c2c0123e152eb03bce41d748 Mon Sep 17 00:00:00 2001 From: Linah Khayri Date: Tue, 7 Jan 2025 19:18:58 +0300 Subject: [PATCH] updating function docstring (no strategy included) --- solutions/factorial_calculator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solutions/factorial_calculator.py b/solutions/factorial_calculator.py index 279f6c00d..281466673 100644 --- a/solutions/factorial_calculator.py +++ b/solutions/factorial_calculator.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- """ Module Name: factorial_calculator + Description: This module provides a function to calculate the factorial of a given number. -It uses a recursive approach to compute the factorial. The module includes: the following function: - factorial_calculator(num): Returns the factorial of the input number num. @@ -15,7 +15,7 @@ def factorial_calculator(num: int | float) -> int: """ - This function calculates the factorial of a non-negative integer or whole float using recursion. + This function calculates the factorial of a non-negative integer or whole float. The factorial of a non-negative integer n is the product of all positive integers less than or equal to num until we reach one. @@ -64,6 +64,6 @@ def factorial_calculator(num: int | float) -> int: if num == 1: # Base case 2 return 1 # turn-around 2 - # Recursive case: factorial(num) = num * factorial(num-1) + # Recursive case: factorial_calculator(num) = num * factorial_calculator(num-1) # breaking-down num | Build-up by multiplying return num * factorial_calculator(num - 1)