title: python: string of hex values to binary
body: <p>This is a sample of my input:</p>
  
  <pre><code>a = 41cf4a077a7454
  </code></pre>
  
  <p>They represent hex values, x41 xCF x4A etc...</p>
  
  <p>I require to convert them into one string of binary like this (DESIRED OUTPUT):</p>
  
  <pre><code>01000001110011110100101000000111011110100111010001010100
  </code></pre>
  
  <p>x41 = 01000001
  xCF = 11001111 
  x4A = 01001010
  etc...</p>
  
  <p>The code I used to do it looked like this:</p>
  
  <pre><code>return bin(int(str(a), 16))[2:]
  </code></pre>
  
  <p>However, it produces a string without a zero at the front:</p>
  
  <pre><code>1000001110011110100101000000111011110100111010001010100
  </code></pre>
  
  <p>It appears the zero gets chopped as it's interpreted as an integer.
  Is there a way I can keep the zero, because not every string being converted begins with a zero in binary.</p>
  
  <p>I hope this makes sense. Thank you.</p>