input: Write a python function to split the data into training and test sets and train a RandomForestClassifier model. The function should return the trained model and predictions on the test set.
  assert isinstance(train_and_predict(dataframe)[0], RandomForestClassifier)
  assert len(train_and_predict(dataframe)[1]) == len(dataframe) * 0.2
output: def train_and_predict(dataframe):
      from sklearn.model_selection import train_test_split
      from sklearn.ensemble import RandomForestClassifier
      from sklearn.metrics import accuracy_score
  
      # Assuming the last column is the target variable
      X = dataframe.iloc[:, :-1]
      y = dataframe.iloc[:, -1]
  
      # Splitting the dataset 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)
  
      # Creating and training the model
      model = RandomForestClassifier(random_state=42)
      model.fit(X_train, y_train)
  
      # Making predictions on the test set
      predictions = model.predict(X_test)
  
      return model, predictions