title: How to add X number of spaces to a string
body: <p>Probably an easy question that I couldn't quite find answer to before...</p>
  
  <p>I'm formatting a table (in text) to look like this:</p>
  
  <pre><code>Timestamp: Word                        Number
  </code></pre>
  
  <p>The number of characters between the : after timestamp and the beginning of Number is to be 20, including those in the Word (so it stays aligned). Using python I've done this:</p>
  
  <pre><code>    offset = 20 - len(word)
  
      printer = timestamp + ' ' + word
      for i in range(0, offset):
          printer += ' '
      printer += score
  </code></pre>
  
  <p>Which works, but python throws an error at me that i is never used ('cause it's not). While it's not a huge deal, I'm just wondering if there's a better way to do so.</p>
  
  <p>Edit:</p>
  
  <p>Since I can't add an answer to this (as it's marked duplicate) the better way to replace this whole thing is</p>
  
  <pre><code>printer = timestamp + ' ' + word.ljust(20) + score
  </code></pre>