How to create a new list from list1 – list 2 in python

How to create a new list from list1 – list 2 in python

List comprehension will do:

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

How to create a new list from list1 – list 2 in python

Leave a Reply

Your email address will not be published. Required fields are marked *