I am looking for a way to remove all values within a list from another list.
Something like this:
a = range(1,10) a.remove([2,3,7]) print a a = [1,4,5,6,8,9]
Python has a language feature called List Comprehensions that is perfectly suited to making this sort of thing extremely easy. The following statement does exactly what you want and stores the result in
l3 = [x for x in l1 if x not in l2]
l3 will contain