title: Get the string in 2 digit format with leading zeros in python
body: <p>I have a requirement to add 2 string which are in mac format as hex which has 9 octets. As part of that I have achieved almost, but one final thing pending is to get the value in 2 digit format.</p>
  
  <pre><code>string1= "aa.aa.aa.aa.aa.aa.aa.aa.ff"
  string2= "00.00.00.00.00.00.00.00.01" 
  </code></pre>
  
  <p>when I add these 2 the out put I get is <code>aa.aa.aa.aa.aa.aa.aa.ab.0</code> but I want value to be <code>aa.aa.aa.aa.aa.aa.aa.ab.00</code> . (2 zeros).</p>
  
  <p>I tried using </p>
  
  <pre><code>temp = '%02d' % string3 
  </code></pre>
  
  <p>but I got error </p>
  
  <pre><code>TypeError: %d format: a number is required, not str
  </code></pre>
  
  <p>as I am trying to do that with string.</p>