input: Write a python function to train a simple linear regression model and return its R2 score. 
  assert train_and_score(pd.DataFrame({'X': [1,2,3,4,5,6], 'y': [13, 23, 32, 43, 51,64]})) == 1.0
  assert train_and_score(pd.DataFrame({'X': [1,2,3,4,5,6], 'y': [1, 2, 3, 4, 5,6]})) == 1.0
  assert train_and_score(pd.DataFrame({'X': [1,2,3,4,5,6], 'y': [2, 4, 6, 8, 10,12]})) == 1.0
output: def train_and_score(df):
      from sklearn.linear_model import LinearRegression
      from sklearn.metrics import r2_score
  
      X = df[['X']]
      y = df['y']
      
      model = LinearRegression()
      model.fit(X, y)
      predictions = model.predict(X)
      
      return r2_score(y, predictions)