Optimize a given Python code to print the factorial of a number.
5
def factorial(n): 
    factorial = 1
  
    for i in range(1, n+1): 
        factorial = factorial * i 
    print(factorial) 
  
number = 5
factorial(number)