title: How can I insert spaces at certain locations in a string (Python 2.7)?
body: <p>I've found many related questions, and a couple that have at least helped me get this far. My goal is to have a function that receives a string and an arbitrary number of integers. I want the function to return that string with spaces inserted at the points given in the arguments. I will use this function with many different strings that will have varying numbers of inserts and insert locations. </p>
  
  <p>This is an example of what I'd like to produce:</p>
  
  <p>Input a string like 'ATGCATGCATGCATGC' and indexes (e.g. 4, 7). The output should be 'ATGCA TGC ATGCATGC'. </p>
  
  <p>This is the function that has given me the closest results so far: </p>
  
  <pre><code>def breakRNA(seqRNA, *breakPoint):
      n = 0
      for i in seqRNA:
          n += 1
          for i in breakPoint:
              if i == n:
                  seqRNA = seqRNA[n:] + ' ' + seqRNA[:n]
      return seqRNA     
  </code></pre>
  
  <p>The return string, however, is transposed out of order. Example:</p>
  
  <pre><code>&gt;&gt;&gt; test = breakRNA('AAAAAAAAAAAAAAAAAAAAAAAAAAATTTTTGGGGGGGGCCCCCCCCCC', 5, 8, 14)
  &gt;&gt;&gt; test
  &gt;&gt;&gt; 'TTTTTGGGGGGGGCCCCCCCCCC AAAAA AAAAAAAA AAAAAAAAAAAAAA'
  </code></pre>
  
  <p>I am a day-1 beginner so any advice is appreciated. Thank you.</p>