title: Bioinformatics: matching list items with dictionary keys and printing the matching keys
body: <p>Homework assistance</p>
  
  <p>I need to write a function which has the ability to take in a string containing DNA codons from a user e.g.</p>
  
  <pre><code>'ACATTTGCTTCTGACACAACTGTGTTCACTAGCAACCTCAAAC'
  </code></pre>
  
  <p>separate the string into groups of 3, then match each group with the dictionary items. but the program must only print out the keys, not the values.</p>
  
  <p>input: <code>ATTGHIATGTTTTTCTYU</code></p>
  
  <p>separation:<code>[ATT] [GHI] [ATG] [TTT] [TTC] [TYU]</code></p>
  
  <p>output: <code>IMFF</code></p>
  
  <p>This is what I have so far</p>
  
  <pre><code>dna_codons = {'I': 'ATT' 'ATC' 'ATA',
                'L': 'CTT' 'CTC' 'CTA' 'CTG' 'TTA' 'TTG',
                'V': 'GTT' 'GTC' 'GTA' 'GTG',
                'F': 'TTT' 'TTC',
                'M': 'ATG',
                }
  def translate(sequence):
      n = 3
      MyList = [sequence[i:i+n] for i in range(0, len(sequence), n)]
      for codon in MyList:
          for slc in dna_codons.keys():
              if codon == slc:
                  print slc
  
  print translate(raw_input('type in DNA sequence: '))
  </code></pre>