input: Write a python function to predict the price of a car given its features using a trained model.
  assert predict_car_price(df, new_row) == predicted_price
  assert predict_car_price(df, {'make': 'Toyota', 'model': 'Camry', 'year': 2019, 'features': '4-cylinder engine, sunroof'}) > 0
  assert predict_car_price(df, {'make': 'Ford', 'model': 'F-150', 'year': 2021, 'features': 'V8 engine, leather seats'}) > 0
output: def predict_car_price(df, new_row):
      from sklearn.model_selection import train_test_split
      from sklearn.linear_model import LinearRegression
      import pandas as pd
  
      # Preprocessing the dataframe
      X = df.drop('price', axis=1)
      y = df['price']
  
      # Convert categorical variables to dummy variables
      X = pd.get_dummies(X)
  
      # Align the new_row with the features in the dataframe
      new_row = pd.DataFrame([new_row])
      new_row = pd.get_dummies(new_row)
      new_row = new_row.reindex(columns=X.columns, fill_value=0)
  
      # Splitting the data into training and testing sets
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
  
      # Training the model
      model = LinearRegression()
      model.fit(X_train, y_train)
  
      # Predicting the price of the new car
      predicted_price = model.predict(new_row)[0]
  
      return predicted_price