input: Write a python function to train a linear regression model using given data and predict the grade for a given input.
  assert predict_grade(1000, [1000], [78]) == 78.0
  assert predict_grade(2000, [1000, 2000], [78, 88]) == 88.0
  assert predict_grade(1500, [1000, 2000], [78, 88]) == 83.0
output: def predict_grade(x, x_data, y_data):
      from sklearn.linear_model import LinearRegression
      import numpy as np
      
      # Convert data to numpy arrays and reshape for sklearn
      x_data = np.array(x_data).reshape(-1, 1)
      y_data = np.array(y_data)
      
      # Create and train the model
      model = LinearRegression()
      model.fit(x_data, y_data)
      
      # Predict the grade for the given input
      predicted_grade = model.predict(np.array([[x]]))
      
      return float(predicted_grade[0])