input: Write a python function to count the number of elements between two specified elements in a list.
  assert count_elements([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3, 8) == 4
  assert count_elements(['a', 'b', 'c', 'd', 'e'], 'b', 'e') == 2
  assert count_elements([5, 6, 7, 8, 9, 10], 5, 10) == 4
output: def count_elements(lst, elem1, elem2):
      try:
          index1 = lst.index(elem1)
          index2 = lst.index(elem2)
          if index1 < index2:
              return index2 - index1 - 1
          elif index2 < index1:
              return index1 - index2 - 1
          else:
              return 0
      except ValueError:
          return -1