input: Write a function to answer questions using TF-IDF vectorizer and cosine similarity.
  assert answer_question("What is a function in Python?") == "In Python, a function is a block of code that can be reused multiple times with different input parameters to perform a certain task."
  assert answer_question("What is a variable?") == "A variable is a name for a location in memory where a value can be stored"
  assert answer_question("What is a loop?") == "A loop is a programming construct that allows a set of instructions to be repeated or iterated until a certain condition is met"
output: from sklearn.feature_extraction.text import TfidfVectorizer
  from sklearn.metrics.pairwise import cosine_similarity
  import numpy as np
  
  def answer_question(question):
      responses = {
          "What is a function in Python?": "In Python, a function is a block of code that can be reused multiple times with different input parameters to perform a certain task.",
          "What is a variable?": "A variable is a name for a location in memory where a value can be stored",
          "What is a loop?": "A loop is a programming construct that allows a set of instructions to be repeated or iterated until a certain condition is met"
      }
  
      questions = list(responses.keys())
      answers = list(responses.values())
      
      corpus = questions + [question]
      
      vectorizer = TfidfVectorizer().fit_transform(corpus)
      vectors = vectorizer.toarray()
      
      cosine_matrix = cosine_similarity(vectors[-1], vectors[:-1])
      best_match_index = np.argmax(cosine_matrix)
      
      return answers[best_match_index]