input: Write a python function to preprocess data and split it into training and test sets, then save the sets to CSV files.
  assert os.path.exists('train_X.csv')
  assert os.path.exists('test_X.csv')
  assert os.path.exists('train_y.csv')
  assert os.path.exists('test_y.csv')
output: def preprocess_and_split_data(data, target_column, test_size=0.2, random_state=42):
      from sklearn.model_selection import train_test_split
      import pandas as pd
  
      # Split the data into features and target
      X = data.drop(columns=[target_column])
      y = data[target_column]
  
      # Split the data into training and test sets
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=test_size, random_state=random_state)
  
      # Save the datasets to CSV files
      X_train.to_csv('train_X.csv', index=False)
      X_test.to_csv('test_X.csv', index=False)
      y_train.to_csv('train_y.csv', index=False)
      y_test.to_csv('test_y.csv', index=False)