Remove elements from a list

Here’s the simplest solution I can think of, which uses a list comprehension. This creates a new list and assigns it to the variable list1.

list1 = [x for x in list1 if x not in list2]

If you need to modify the original list instead of creating a new list, you can do

list1[:] = [x for x in list1 if x not in list2]