title: Length of hexadecimal number
body: <p>How can we get the length of a hexadecimal number in the Python language?
  I tried using this code but even this is showing some error.</p>
  
  <pre><code>i = 0
  def hex_len(a):
      if a &gt; 0x0:
          # i = 0
          i = i + 1
          a = a/16
          return i
  b = 0x346
  print(hex_len(b))
  </code></pre>
  
  <p>Here I just used 346 as the hexadecimal number, but my actual numbers are very big to be counted manually.</p>