title: Converting from HEX string to int without removing leading zeroes on Python
body: <p>I need help on converting HEX string to int. I have a big data input, but,
  Here's one example from the data:</p>
  
  <pre><code>def convert_hex_to_int(n:int, interval:int):
          splitted = [hex(n)[2:][i:i + interval] for i in range(0, len(hex(n)[2:]), interval)]
          return [float(int(hex(unpack('&lt;H', pack('&gt;H', int(i, 16)))[0]), 16)) for i in splitted]
  
      a='0x0E070907'
  hex_int = int(a, 16)
  result_print = (convert_hex_to_int(hex_int, 4))
  </code></pre>
  
  <p>and 
  instead of</p>
  
  <blockquote>
    <p>[1806.0, 1801.0]</p>
  </blockquote>
  
  <p>the result is</p>
  
  <blockquote>
    <p>[28896.0, 1801.0]</p>
  </blockquote>
  
  <p>the function convert_hex_to_int is to split the string into 2 bytes and swap it, with the interval of 4 bytes. And the purpose of the code it to acquire the floating points of the HEX String. I suspected it has to do the Python removing the first zero on the front of 070E, and instead, it becomes 70E0. </p>
  
  <ul>
  <li>I have read some similar problems in Stackoverflow but still didn't work. 
  And I'm new to python.
  Thanks for your help. </li>
  </ul>