title: How to solve ValueError: invalid literal for int() with base 16 error in python
body: <p>I tries to convert a hexadecimal to a decimal number in python. I tried the following:</p>
  
  <pre><code>if isinstance(expr, pyvex.IRExpr.Load):
        loadaddr = expr.addr
         s = int (loadaddr, 16)
         print s
  </code></pre>
  
  <p>But I encountered error: 
  TypeError: int() can't convert non-string with explicit base``</p>
  
  <p>Then I tried the following:</p>
  
  <pre><code>i = int('"{}"'.format(loadaddr), 16) 
  print i
  </code></pre>
  
  <p>Now I encountered the following error:
  ValueError: invalid literal for int() with base 16: '"0x00000000004017c0"'
  .Can anyone help me please?</p>