title: Python looping doesn't give expected output
body: <p>I am trying to find the missing elements between arr1 and arr2 but not sure what's the issue with the code, why it's not working. Please suggest.</p>
  
  <pre><code>def miss2(arr1, arr2):
      arr3=arr1
      for i in arr1:
          # print(i)
          for j in arr2:
              # print(i,j)
              if i == j:
                  arr3.remove(j)
  
      print(arr3)
  
  arr1=[1,2,3,4]
  arr2=[1,2]
  
  miss2(arr1,arr2)
  </code></pre>
  
  <p>result:<code>[2, 3, 4]</code> instead of <code>[3, 4]</code></p>