title: Adding/Subtracting Hexadecimals
body: <p>How can I add/subtract hexadecimal's that the user inputs?</p>
  
  <p>Like: </p>
  
  <pre><code>basehex = input()
  sechex = input()
  
  sum = hex(basehex - sechex)
  
  
  
  print(sum)
  </code></pre>
  
  <p>I get: <em>TypeError: unsupported operand type(s) for -: 'str' and 'str'</em></p>
  
  <p>How do I do this? Must I convert them to <em>int</em>? Then I can't have them as hex (0xFFFFFF)...?</p>
  
  <p>The only way I can do it is:</p>
  
  <pre><code>basehex = int('255')
  sechex = int('255')
  
  sum = hex(basehex - sechex)
  
  
  
  print(sum)
  </code></pre>
  
  <p>But this requires me to enter basehex/sechex as numbers, since int won't take it otherwise:</p>
  
  <pre><code>ValueError: invalid literal for int() with base 10: 'ff'
  </code></pre>
  
  <p>Thanks :) </p>