title: Centering the string with format and a variable
body: <p>I want to know how to write a string thats being centerd like so:</p>
  
  <pre><code>print("{0:^30s}".format("hello"))
  </code></pre>
  
  <p>but I want the 30 to be a variable instead, so If I send a "num=5" to a function it would be {0:^5s}, anyone knows the right syntax?</p>