okmich commited on
Commit
065fe36
·
verified ·
1 Parent(s): 849a13b

Fix bug with get_factorial

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 the number for which factorial will be calculated.
41
  """
42
  if number < 1:
43
  return "0"
44
- elif number > 40:
45
  return "Too large number"
46
  fact = 1
47
- for i in range(1, n + 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