title: Pythonic formatting from 1 to 01
body: <p>I want to be able to be able to format date/time input for my function.</p>
  
  <p>Currently, I have a function that basically appends a 0 to a number if it is only 1 digit long.</p>
  
  <pre><code>def format_num(str(num)):
      if len(num) &lt; 2:
          return "0" + num
      return num
  </code></pre>
  
  <p>I was wondering if there was a more pythonic way to do this. </p>