title: Python Hexadecimal
body: <p>How to convert decimal to hex in the following format (at least two digits, zero-padded, without an 0x prefix)?</p>
  
  <p>Input: <code>255</code>    Output:<code>ff</code> </p>
  
  <p>Input: <code>2</code>       Output: <code>02</code></p>
  
  <p>I tried <code>hex(int)[2:]</code> but it seems that it displays the first example but not the second one. </p>