title: Calculate average transcript length of random RNA sequences that have a fixed gc content
body: <p>trying to calculate average transcript length of random RNA sequences that have a fixed gc content ( 10%, 20%, 30%, …, 90%)</p>
  
  <pre><code>def bias_rna(gc_content):
      rna = 'AUG'
      stop_codon = ['UAG','UAA','UGA']
      while rna[-3:] not in stop_codon:
          for _ in range(3):
              rna += random.choice(('A'+'U')*(100-(gc_content))+('C'+'G')*(gc_content))
      return rna
  
  
  for numb in [range(10,91,10)]:
      rna2_list = []
      for _ in range(1001):
          rna2_list.append(bias_rna(numb))
      rna2_len = []
      for s in rna2_list:
          rna2_len.append(len(s))
      print ('Average random rna length with  cg: %.2f' % (sum(rna_len)/(len(rna_len))))
  </code></pre>
  
  <p>however, the program doesn't work.. suggestions? </p>