# Compute n factorial for an n value entered by the user. # Read n from the user n = int(input("Enter an integer: ")) # Initialize count and result count = 1 result = 1 # While count is less than or equal to n while count <= n: # Multiply the result so far by count result = result * count # Increment count count = count + 1 # Display the result print(n, "factorial is equal to", result)