input: Write a python function to convert a list into a dictionary where list elements are keys and their indices are values.
  assert list_to_dict(['a', 'b', 'c']) == {'a': 0, 'b': 1, 'c': 2}
  assert list_to_dict([1, 2, 3, 4]) == {1: 0, 2: 1, 3: 2, 4: 3}
  assert list_to_dict(['apple', 'banana', 'cherry']) == {'apple': 0, 'banana': 1, 'cherry': 2}
output: def list_to_dict(lst):
      return {element: index for index, element in enumerate(lst)}