Write a Python program to print out the factorial of a number.
7
def factorial(x):
    factorial = 1
    while x > 1:
        factorial = factorial * x
        x = x - 1
    return factorial

number = 7
result = factorial(number)
print(result)