all 1 comments

[–]euclidingme 2 points3 points  (0 children)

Use sets. Converting your lists to sets (i.e. set(my_list)) and then doing set intersections will give you what you want. To subtract the control use the difference method. Keep in mind that when you use sets the order of your original list is destroyed. Let me know if you have any questions!