0

I have the list1= [com.x1 ,com.x2 com.x3] and i have the one more list list2= [com.x3].

i need the one more list as list3=[com.x1 , com.x2 ] like list1-list2.

Please help me in this.

saleelm
  • 15
  • 1
  • 1
  • 6

1 Answers1

6

List comprehension will do:

[x for x in list1 if x not in list2]
Netwave
  • 40,134
  • 6
  • 50
  • 93