title: How do I left-align numbers in columns in Python?
body: <p>I am trying to write a function that passes this doctest:</p>
  
  <pre><code>Prints a table of values for i to the power of 1,2,5 and 10 from 1 to 10
  left aligned in columns of width 4, 5, 8 and 13
  &gt;&gt;&gt; print_function_table()
  i   i*2 i*5    i*10
  1   1    1       1
  2   4    32      1024
  3   9    243     59049
  4   16   1024    1048576
  5   25   3125    9765625
  6   36   7776    60466176
  7   49   16807   282475249
  8   64   32768   1073741824
  9   81   59049   3486784401
  10  100  100000  10000000000
  </code></pre>
  
  <p>I feel like I am almost there but I can't seem to left-align my columns.</p>
  
  <p>the code i have is:</p>
  
  <pre><code>def print_function_table():
      i = 1
      s = "{:^4} {:^5} {:^8} {:^13}"
      print s.format("i", "i*2", "i*5", "i*10")
      while i &lt;= 10:
          print s.format(i, i*2, i*5, i*10)
          i += 1
  </code></pre>