input: Write a python function to train a K Nearest Neighbors classifier and make a prediction for a given input sample.
  assert knn_prediction([[1, 2, 0], [4, 4, 1], [5, 6, 1], [8, 8, 0]], [4, 4]) == 1
  assert knn_prediction([[3, 3, 1], [2, 2, 0], [7, 7, 1], [9, 9, 0]], [3, 3]) == 1
  assert knn_prediction([[1, 1, 0], [6, 6, 1], [7, 7, 1], [4, 5, 0]], [4, 5]) == 0
output: def knn_prediction(data, input_sample):
      from sklearn.neighbors import KNeighborsClassifier
      import numpy as np
      
      # Extract features and labels from data
      X = np.array([sample[:-1] for sample in data])
      y = np.array([sample[-1] for sample in data])
      
      # Instantiate the classifier
      knn = KNeighborsClassifier(n_neighbors=3)
      
      # Train the classifier
      knn.fit(X, y)
      
      # Make a prediction
      prediction = knn.predict([input_sample])
      
      return prediction[0]