title: modifying list of characters in python
body: <p>I have a program for creating a FASTA file of sequences.</p>
  
  <pre><code>input=['ARIMALTHNAEYSDSFTAL','ARIMFLTHNFEYSESFTAL','AHIMNPTENAEYHESFTAL','AHIMNPTENTEYWDSFTAL','AHIMNDTHNFEYHDSFTAL','AHIMNDTNNTEYWESFTAL','ARIMFDTENAEYHDSFTAL','AHIMADTNNTEYWDSFTAL','ARIMFLTENTEYHESFTAL']
  
  l = len(input[0])
  
  my_residues = [set() for _ in xrange(l)]
  for h in input: 
      for i, x in enumerate(h): 
          my_residues[i].add(x)
  
  my_residues = [list(x) for x in my_residues]
  print my_residues
  </code></pre>
  
  <p>This will give output like this</p>
  
  <pre><code>[['A'], ['H', 'R'], ['I'], ['M'], ['A', 'N', 'F'], ['P', 'L', 'D'], ['T'], ['H', 'E', 'N'], ['N'], ['A', 'T', 'F'], ['E'], ['Y'], ['H', 'S', 'W'], ['E', 'D'], ['S'], ['F'], ['T'], ['A'], ['L']]
  </code></pre>
  
  <p>but I want the output in such a way that all amino acid residues are there in a set if it contains more than one residue.
  So the output should look like:</p>
  
  <pre><code>[['A'], ['A','C','D','E','F','G','H','I','K','L','M','N','P','Q','R','S','T','V','W','Y'], ['I'], ['M'], ['A','C','D','E','F','G','H','I','K','L','M','N','P','Q','R','S','T','V','W','Y'], ['A','C','D','E','F','G','H','I','K','L','M','N','P','Q','R','S','T','V','W','Y'], ['T'], ['A','C','D','E','F','G','H','I','K','L','M','N','P','Q','R','S','T','V','W','Y'],......  ['F'], ['T'], ['A'], ['L']]
  </code></pre>