title: Add numbers in hexadecimal base manually
body: <p>I'm supposed to write a code which gets two numbers in hexadecimal base and calculates their sum without converting bases, which means it should calculate it in hexadecimal base for example:</p>
  
  <pre><code>     1 f 5 (A) 
  +      5 a (B) 
  ------------- 
     = 2 4 f 
  </code></pre>
  
  <p>and input example for the function would be :</p>
  
  <pre><code>&gt;&gt;&gt; add("a5", "17") 
  </code></pre>
  
  <p>'bc'</p>
  
  <p>I've written this code so far but I have no clue how to continue, I thought that I would create three loops, one would sum numbers, the other would sum numbers and letters and the third would sum letters.</p>
  
  <pre><code>def add_hex(A,B):
      lstA = [int(l) for l in str(A)]
      lstB = [int(l) for l in str(B)]
  
      if len(A)&gt;len(B):
          A=B
          B=A
      A='0'*(len(B)-len(A))+A
      remainder=False
      result=''
      for i in range(len(B)-1):
          if (A[i]&gt;0 and A[i]&lt;10) and (B[i]&gt;0 and B[i]&lt;10):
             A[i]+B[i]=result
             if A[i]+B[i]&gt;10:
                 result+='1'
  </code></pre>