Spaces:
Sleeping
Sleeping
Fix bug with get_factorial
Browse files
app.py
CHANGED
|
@@ -37,14 +37,14 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 37 |
def get_factorial(number: int) -> str:
|
| 38 |
"""A tool that calculates the factorial of a given number.
|
| 39 |
Args:
|
| 40 |
-
number: A string representing a
|
| 41 |
"""
|
| 42 |
if number < 1:
|
| 43 |
return "0"
|
| 44 |
-
elif number >
|
| 45 |
return "Too large number"
|
| 46 |
fact = 1
|
| 47 |
-
for i in range(1,
|
| 48 |
fact *= i
|
| 49 |
return str(fact)
|
| 50 |
|
|
|
|
| 37 |
def get_factorial(number: int) -> str:
|
| 38 |
"""A tool that calculates the factorial of a given number.
|
| 39 |
Args:
|
| 40 |
+
number: A string representing a number for which factorial will be calculated.
|
| 41 |
"""
|
| 42 |
if number < 1:
|
| 43 |
return "0"
|
| 44 |
+
elif number > 20:
|
| 45 |
return "Too large number"
|
| 46 |
fact = 1
|
| 47 |
+
for i in range(1, number + 1):
|
| 48 |
fact *= i
|
| 49 |
return str(fact)
|
| 50 |
|