title: Python add leading zeroes using str.format
body: <p>Can you display an integer value with leading zeroes using the <a href="http://docs.python.org/2/library/stdtypes.html#str.format"><code>str.format</code></a> function?</p>
  
  <p><strong>Example input:</strong></p>
  
  <pre><code>"{0:some_format_specifying_width_3}".format(1)
  "{0:some_format_specifying_width_3}".format(10)
  "{0:some_format_specifying_width_3}".format(100)
  </code></pre>
  
  <p><strong>Desired output:</strong> </p>
  
  <pre><code>"001"
  "010"
  "100"
  </code></pre>
  
  <p>I know that both <code>zfill</code> and <code>%</code>-based formatting (e.g. <code>'%03d' % 5</code>) can accomplish this. However, I would like a solution that uses <code>str.format</code> in order to keep my code clean and consistent (I'm also formatting the string with datetime attributes) and also to expand my knowledge of the <a href="http://docs.python.org/2/library/string.html#format-specification-mini-language">Format Specification Mini-Language</a>.</p>