input: Write a python function to calculate the frequency of elements in a list.
  assert frequency(["apple", "banana", "apple", "cherry", "banana", "banana"]) == {'apple': 2, 'banana': 3, 'cherry': 1}
  assert frequency(["cat", "dog", "cat", "mouse", "dog", "cat"]) == {'cat': 3, 'dog': 2, 'mouse': 1}
  assert frequency([1, 2, 2, 3, 1, 1, 4, 4, 4]) == {1: 3, 2: 2, 3: 1, 4: 3}
output: def frequency(lst):
      freq_dict = {}
      for item in lst:
          if item in freq_dict:
              freq_dict[item] += 1
          else:
              freq_dict[item] = 1
      return freq_dict