input: Write a function to predict outcomes using logistic regression.
  assert predict_outcome(pd.DataFrame([['Team A', 'Team B', 3, 11], ['Team C', 'Team D', 2, 9], [1, 0]]))==0
  assert predict_outcome(pd.DataFrame([['Team E', 'Team F', 1, 5], ['Team G', 'Team H', 4, 12], [0, 1]]))==1
output: from sklearn.linear_model import LogisticRegression
  import pandas as pd
  
  def predict_outcome(df):
      # Split the input DataFrame into training data and test data
      train_data = df.iloc[:-1, :]
      test_data = df.iloc[-1, :].values.reshape(1, -1)
      
      # Separate features and labels
      X_train = train_data.iloc[:, 2:].values
      y_train = train_data.iloc[:, 0].apply(lambda x: 1 if x == 'Team A' else 0).values
      
      # Initialize and train the logistic regression model
      model = LogisticRegression()
      model.fit(X_train, y_train)
      
      # Predict the outcome for the test data
      prediction = model.predict(test_data)
      
      return int(prediction[0])