diff --git a/factorial b/factorial new file mode 100644 index 0000000..73e4b93 --- /dev/null +++ b/factorial @@ -0,0 +1,11 @@ +def factorial(n): + if n == 0 or n == 1: + return 1 + else: + return n * factorial(n - 1) + +# Example usage: +number = 5 +result = factorial(number) + +print(f"The factorial of {number} is {result}.")