title: Comparing two lists and only printing the differences? (XORing two lists)
body: <p>I'm trying to create a function that takes in 2 lists and returns the list that only has the differences of the two lists.</p>
  
  <p>Example: </p>
  
  <pre><code>a = [1,2,5,7,9]
  b = [1,2,4,8,9]
  </code></pre>
  
  <p>The result should print <code>[4,5,7,8]</code></p>
  
  <p>The function so far:</p>
  
  <pre><code>def xor(list1, list2):
      list3=list1+list2
      for i in range(0, len(list3)):
          x=list3[i]
          y=i
          while y&gt;0 and x&lt;list3[y-1]:
              list3[y]=list3[y-1]
              y=y-1
          list3[y]=x
  
          last=list3[-1]
      for i in range(len(list3) -2, -1, -1):
          if last==list3[i]:
              del list3[i]
          else:
              last=list3[i]
  
      return list3 
  print xor([1,2,5,7,8],[1,2,4,8,9])
  </code></pre>
  
  <p>The first for loop sorts it, second one removes the duplicates. Problem is the result is 
  <code>[1,2,4,5,7,8,9]</code> not <code>[4,5,7,8]</code>, so it doesn't completely remove the duplicates? What can I add to do this. 
  I can't use any special modules, .sort, set or anything, just loops basically. </p>