fork download
  1. def remove_dups(L1, L2):
  2. i = 0
  3. while i < len(L1):
  4. if L1[i] in L2:
  5. L1.remove(L1[i])
  6. else:
  7. i += 1
  8.  
  9. L1 = [1, 2, 3, 4]
  10. L2 = [1, 2, 5, 6]
  11. remove_dups(L1, L2)
  12. print(L1)
  13.  
  14. #https://pt.stackoverflow.com/q/288232/101
Success #stdin #stdout 0.02s 9176KB
stdin
Standard input is empty
stdout
[3, 4]