input: Write a function to create a Python script for a Kaggle competition that loads necessary libraries, reads data, splits it, defines and fits a model, makes predictions, scores the predictions, and prepares a submission. If the data is read correctly, the function should return True, otherwise False.
  assert kaggle_script("data.csv")==True
  assert kaggle_script("nonexistent_file.csv")==False
output: def kaggle_script(file_path):
      try:
          import pandas as pd
          from sklearn.model_selection import train_test_split
          from sklearn.ensemble import RandomForestClassifier
          from sklearn.metrics import accuracy_score
  
          data = pd.read_csv(file_path)
          X = data.drop('target', axis=1)
          y = data['target']
          X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
  
          model = RandomForestClassifier()
          model.fit(X_train, y_train)
  
          y_pred = model.predict(X_test)
          score = accuracy_score(y_test, y_pred)
  
          submission = pd.DataFrame({'id': data['id'], 'target': model.predict(X)})
          submission.to_csv('submission.csv', index=False)
  
          return True
      except:
          return False