input: Write a python function to train a KNeighborsClassifier on a given dataframe and make a prediction.
  assert knn_classifier_and_predict(pd.DataFrame([['Red', 11, 0.3, 6.8], ['White', 12, 0.5, 5.3]], columns=['Type', 'Alk', 'Res', 'Mal']), [[11.4, 0.3, 6.6]])==['Red']
  assert knn_classifier_and_predict(pd.DataFrame([['Red', 13, 0.3, 6.8], ['White', 10, 0.4, 5.1]], columns=['Type', 'Alk', 'Res', 'Mal']), [[12, 0.35, 6.7]])==['Red']
  assert knn_classifier_and_predict(pd.DataFrame([['Red', 11, 0.3, 6.8], ['White', 12, 0.5, 5.3], ['Red', 14, 0.6, 7.2]], columns=['Type', 'Alk', 'Res', 'Mal']), [[13, 0.4, 7.0]])==['Red']
output: def knn_classifier_and_predict(df, predict_data):
      from sklearn.neighbors import KNeighborsClassifier
      from sklearn.preprocessing import LabelEncoder
  
      X = df[['Alk', 'Res', 'Mal']]
      y = df['Type']
  
      le = LabelEncoder()
      y_encoded = le.fit_transform(y)
  
      knn = KNeighborsClassifier(n_neighbors=3)
      knn.fit(X, y_encoded)
  
      prediction_encoded = knn.predict(predict_data)
      prediction = le.inverse_transform(prediction_encoded)
  
      return list(prediction)