input: Write a python function to search for a word in a list of words and return its index.
  assert search(['hello', 'world', 'python', 'language'], 'language') == 3
  assert search(['apple', 'banana', 'cherry', 'date'], 'banana') == 1
  assert search(['a', 'b', 'c', 'd'], 'e') == -1
output: def search(words, target):
      try:
          return words.index(target)
      except ValueError:
          return -1