input: Write a function to write a Python script that competes in a Kaggle competition. The script should load necessary libraries, read in the data, split the data into training and testing sets, define and fit a model, make predictions on the test set, score the predictions using accuracy score, and submit the prediction to Kaggle.
  assert kaggle_competition_script() # Assert the function runs without errors
output: def kaggle_competition_script():
      import pandas as pd
      from sklearn.model_selection import train_test_split
      from sklearn.ensemble import RandomForestClassifier
      from sklearn.metrics import accuracy_score
  
      # Load data
      train_data = pd.read_csv('train.csv')
      test_data = pd.read_csv('test.csv')
  
      # Split data
      X = train_data.drop('target', axis=1)
      y = train_data['target']
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
  
      # Define and fit model
      model = RandomForestClassifier(random_state=42)
      model.fit(X_train, y_train)
  
      # Make predictions
      y_pred = model.predict(X_test)
  
      # Score predictions
      accuracy = accuracy_score(y_test, y_pred)
      print(f'Accuracy: {accuracy}')
  
      # Make predictions on test data for submission
      test_predictions = model.predict(test_data.drop('id', axis=1))
  
      # Create submission file
      submission = pd.DataFrame({'id': test_data['id'], 'target': test_predictions})
      submission.to_csv('submission.csv', index=False)