input: Write a function to implement the Gradient Descent Algorithm. The function should take in a list of x values, a list of y values, a learning rate, and the number of iterations to perform, and return the final calculated slope and intercept after performing gradient descent. If the input lists are empty, the function should return (0, 0).
  assert gradient_descent([1, 2, 3, 4, 5], [2, 4, 6, 8, 10], 0.01, 100) == 1, 0
  assert gradient_descent([1, 2, 3], [1, 4, 9], 0.01, 100) == 3, 0
  assert gradient_descent([], [], 0.01, 100) == 0, 0
  assert gradient_descent([2, 4, 6], [3, 9, 15], 0.01, 100) == 3, 1
output: def gradient_descent(x, y, learning_rate, iterations):
      if not x or not y:
          return 0, 0
      
      n = len(x)
      slope = 0
      intercept = 0
      
      for _ in range(iterations):
          y_pred = slope * x + intercept
          slope_gradient = -(2/n) * sum(x * (y - y_pred))
          intercept_gradient = -(2/n) * sum(y - y_pred)
          slope -= learning_rate * slope_gradient
          intercept -= learning_rate * intercept_gradient
      
      return slope, intercept