input: Write a python function to read a CSV file, train a linear regression model using the data, make predictions, and calculate the mean squared error.
  assert isinstance(train_and_evaluate_model('data.csv'), float)
  assert train_and_evaluate_model('data.csv') >= 0
output: import pandas as pd
  from sklearn.linear_model import LinearRegression
  from sklearn.metrics import mean_squared_error
  from sklearn.model_selection import train_test_split
  
  def train_and_evaluate_model(file_path):
      # Read the CSV file
      data = pd.read_csv(file_path)
      
      # Assume that the last column is the target variable
      X = data.iloc[:, :-1]
      y = data.iloc[:, -1]
      
      # Split the data into training and test sets
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
      
      # Train the linear regression model
      model = LinearRegression()
      model.fit(X_train, y_train)
      
      # Make predictions on the test set
      y_pred = model.predict(X_test)
      
      # Calculate the mean squared error
      mse = mean_squared_error(y_test, y_pred)
      
      return mse