# # Compute the value of n-factorial for a non-negative integer. # # Parameters: # n: Non-negative integer for which for the factorial is computed. # # Returns: The value of n-factorial. # def factorial(n): result = 1 for i in range(1, n + 1): result = result * i return result # # Demonstrate the factorial function by computing n-factorial for a value # of n entered by the user. # n = int(input("Enter a non-negative integer: ")) n_fact = factorial(n) print(f"{n}-factorial is equal to {n_fact}.")