input: Write a function to find the index of a character in a string.
  assert search("helloworld", "o") == 4
  assert search("python", "y") == 1
  assert search("datascience", "a") == 1
  assert search("helloworld", "z") == -1
output: def search(s, char):
      try:
          return s.index(char)
      except ValueError:
          return -1