input: Write a python function to convert a list to a dictionary with counts of each element.
  assert list_to_dict(['a', 'a', 'b', 'c']) == {'a': 2, 'b': 1, 'c': 1}
  assert list_to_dict(['x', 'y', 'x', 'x', 'z']) == {'x': 3, 'y': 1, 'z': 1}
  assert list_to_dict(['apple', 'banana', 'apple', 'orange', 'banana', 'banana']) == {'apple': 2, 'banana': 3, 'orange': 1}
output: def list_to_dict(lst):
      result = {}
      for item in lst:
          if item in result:
              result[item] += 1
          else:
              result[item] = 1
      return result