input: Write a function to perform linear regression for predicting the numbers in a given dataset. The function should take in two lists, X and Y, representing the features and target values respectively. After fitting the model, it should predict the value of Y for a given X value. If the input lists are empty, the function should return None.
  assert linear_regression_predict([1,2,3,4,5], [3,5,7,9,13], 7)==15.0
  assert linear_regression_predict([1,2,3], [2,4,6], 4)==8.0
  assert linear_regression_predict([], [], 7)==None
  assert linear_regression_predict([10,20,30], [5, 10, 15], 15)==7.5
  assert linear_regression_predict([1,3,5,7,9], [2,4,6,8,10], 10)==11.0
output: def linear_regression_predict(X, Y, x_value):
      if not X or not Y:
          return None
      n = len(X)
      sum_X = sum(X)
      sum_Y = sum(Y)
      sum_XY = sum(x * y for x, y in zip(X, Y))
      sum_X2 = sum(x ** 2 for x in X)
      slope = (n * sum_XY - sum_X * sum_Y) / (n * sum_X2 - sum_X ** 2)
      intercept = (sum_Y - slope * sum_X) / n
      return slope * x_value + intercept