title: Working with itertools.product and lists in python 3
body: <p>I'm trying to create a possible list of codons given a protein sequence.</p>
  
  <p>Basically, the script i'm trying to create will process a given string input and outputs a possible combinations of another set of strings the input represents.</p>
  
  <p>For example, the character 'F' represents either 'UUU' or 'UUC'; the character 'I' represents either 'AUU', 'AUC', or 'AUA'. </p>
  
  <p>Given the input 'FI', the script I'm trying to create should output:
  'UUUAUU', 'UUUAUC', 'UUUAUA', 'UUCAUU', 'UUCAUC', and 'UUCAUA'.</p>
  
  <p>I'm currently stuck with this code:</p>
  
  <pre><code>import itertools
  
  F = ['UUU', 'UUC']
  I = ['AUU', 'AUC', 'AUA']
  
  seq, pool = 'FI', []
  
  for i in seq:
     pool.append(eval(i))
  
  for n in itertools.product(pool):
     print(n)
  </code></pre>
  
  <p>It works when I replace <code>pool</code> in <code>itertools.product</code> with <code>pool[0], pool[1]</code>. But I can't figure out how to make it work so that the user can input a string with more than 2 character (i.e. not to make it hard-coded).</p>
  
  <p>Thanks in advance for the help!</p>