# # Compute the value of n-factorial using recursion. # # Parameters: # n: the integer for which the factorial is computed # # Returns: n-factorial # def factorial(n): if n == 0: # Base case return 1 else: # Recursive case return n * factorial(n - 1) # # Demonstrate the recursive factorial function. # a = int(input("Enter a non-negative integer: ")) f = factorial(a) print(f"{a} factorial is equal to {f}")