input: Write a python function to train a Multinomial Naive Bayes classifier on a given dataset and make predictions.
  assert train_and_predict(['example1', 'example2'], [0, 1], ['example3']) == [1]
  assert train_and_predict(['text1', 'text2', 'text3'], [0, 1, 0], ['text4', 'text5']) == [0, 0]
  assert train_and_predict(['sample1', 'sample2', 'sample3', 'sample4'], [1, 0, 1, 0], ['sample5']) == [1]
output: def train_and_predict(train_data, train_labels, test_data):
      from sklearn.feature_extraction.text import CountVectorizer
      from sklearn.naive_bayes import MultinomialNB
  
      # Create a CountVectorizer to convert text data into a matrix of token counts
      vectorizer = CountVectorizer()
  
      # Fit the vectorizer on the training data and transform the training data
      X_train = vectorizer.fit_transform(train_data)
  
      # Initialize the Multinomial Naive Bayes classifier
      clf = MultinomialNB()
  
      # Train the classifier on the training data and labels
      clf.fit(X_train, train_labels)
  
      # Transform the test data using the same vectorizer
      X_test = vectorizer.transform(test_data)
  
      # Make predictions on the test data
      predictions = clf.predict(X_test)
  
      # Return the predictions as a list
      return predictions.tolist()