# Compute n-factorial for a value of n entered by the user using a for loop # Read the value of n from the user n = int(input("Enter an integer (0 or greater): ")) # Initialize product product = 1 # For each value from n down to and including 1 for factor in range(n, 0, -1): # Include the current factor in the product product = product * factor # Display the result print(n, "factorial is equal to", product)