title: Python code for deleting a list is not working
body: <p>The following function should delete a element in an list if it has an overlap with a first list.
  However it only works with the first example(a and b1). With others it does not even send an error message and I have no idea where there problem lies. Can someone point me in the right direction?</p>
  
  <pre class="lang-py prettyprint-override"><code>def funct(firstone, secondone):
      counter = 0
      while secondone != [] and counter &lt; len(firstone):
          if firstone[counter] in secondone:
              del(secondone[secondone.index(firstone[counter])])
              counter += 1
          return secondone
  
  
  a = [0, 1, 2]
  b1 = [1, 2, 0]
  b2 = [-1, 1, 1]
  b3 = [0, 0, 2]
  print(funct(a, b1))
  print(funct(a, b2))
  print(funct(b3, a))
  
  </code></pre>