title: Checking whether a string starting with 0x is a hex in python
body: <p>I have strings of the form <code>"0x3f"</code>, <code>"0x2d"</code>.</p>
  
  <p>How to check if it is a valid hexadecimal number and how to convert it to decimal value directly?</p>