Optimize a given program written in Python.
def get_factorial(n):
    if n == 1 or n == 0:
        return 1
    else:
        return n * get_factorial(n-1)
def get_factorial(n):
    result = 1
	for i in range(1, n + 1):
		result *= i
	return result