title: Repeat string to certain length
body: <p>What is an efficient way to repeat a string to a certain length? Eg: <code>repeat('abc', 7) -&gt; 'abcabca'</code></p>
  
  <p>Here is my current code:</p>
  
  <pre><code>def repeat(string, length):
      cur, old = 1, string
      while len(string) &lt; length:
          string += old[cur-1]
          cur = (cur+1)%len(old)
      return string
  </code></pre>
  
  <p>Is there a better (more pythonic) way to do this? Maybe using list comprehension?</p>