input: Write a python function to convert a list into a dictionary where keys are indices and values are list elements.
  assert list_to_dict([10, 20, 30, 40]) == {0: 10, 1: 20, 2: 30, 3: 40}
  assert list_to_dict(['a', 'b', 'c']) == {0: 'a', 1: 'b', 2: 'c'}
  assert list_to_dict([True, False]) == {0: True, 1: False}
output: def list_to_dict(lst):
      return {i: lst[i] for i in range(len(lst))}