Answer the question
In order to leave comments, you need to log in
How to remove an element from a list if it is not in another list?
Can you tell me how to remove the elements of a list if it is not in another list?
Let's say we have two lists:
list1 = [1, 2, 3, 4, 5, 6]
list2 = [2, 3, 5]
list1 = [2, 3, 5]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question