input: Write a function to calculate the frequency of each character in a string.
  assert frequency("hello") == {'h': 1, 'e': 1, 'l': 2, 'o': 1}
  assert frequency("frequency") == {'f': 1, 'r': 1, 'e': 2, 'q': 1, 'u': 1, 'n': 1, 'c': 1, 'y': 1}
  assert frequency("aabbcc") == {'a': 2, 'b': 2, 'c': 2}
output: def frequency(string):
      freq_dict = {}
      for char in string:
          if char in freq_dict:
              freq_dict[char] += 1
          else:
              freq_dict[char] = 1
      return freq_dict