title: Convert binary string to hex string and keep its leading zeros
body: <p>May I know how to write a Python script to convert binary string to hexadecimal string and keep the leading zeros?  </p>
  
  <p>For an example, I have binary string <code>"0000000000001010"</code> and would like to print it into <code>"000A"</code>. I know i can use <code>zfill()</code> function, but the number of leading zeros is unknown.</p>