def dnaFrequency(string):
  # Start with a dict where each base we care about starts at 0
  dict = {"A":0, "C":0, "G":0, "T":0}
  # Loop over each base in our DNA string
  for b in string:
    # Update the corresponding dictionary entry by increasing it by 1
    dict[b] = dict[b] + 1
    
  return dict

def valueCounts(dict, val):
  # Start our count at 0
  count = 0
  # Loop over every value in our dictionary
  for v in dict.values():
    # If the value matches the one we are looking for, add 1 to our counter
    if v == val:
      count = count + 1
  
  return count

def getKeysFor(dict, val):
  # Start with the empty list
  keys = []
  # Loop over all key value pairs. In Python the for loop can assign to
  # multiple variables at once. In this case, k will be the key, and v will
  # be the value for each key:value pair in the dictionary
  for k,v in dict.items():
    # If the value matches what we are looking for, add the key to our list
    if v == val:
      keys.append(k)

  return keys

def getKeysFor2(dict, val):
  # Start with the empty list
  keys = []
  # Loop over all key value pairs. In Python a key:value pair is like an array.
  # pair[0] is the key, and pair[1] is the value.
  for pair in dict.items():
    # If the value matches what we are looking for, add the key to our list
    if pair[1] == val:
      keys.append(pair[0])

  return keys