We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8629e78 commit 3351675Copy full SHA for 3351675
maths/factorial_iterative.py
@@ -24,12 +24,12 @@ def factorial(number: int) -> int:
24
>>> factorial(0)
25
1
26
"""
27
- if input_number != int(input_number):
+ if number != int(number):
28
raise ValueError("factorial() only accepts integral values")
29
- if input_number < 0:
+ if number < 0:
30
raise ValueError("factorial() not defined for negative values")
31
value = 1
32
- for i in range(1, input_number + 1):
+ for i in range(1, number + 1):
33
value *= i
34
return value
35
0 commit comments