Answer the question
In order to leave comments, you need to log in
How to print the difference between two lists more quickly?
There are two lists
list1 = ['1111', '2222', '3333', '4444']
list2 = ['1111', '4444']
list3 = []
for i in list1:
if i not in list2:
list3.append(i)
>>> A = [3, 4, 6, 7]
>>> B = [1, 3, 6, 3]
>>> list(map(operator.sub, A, B))
[2, 1, 0, 4]
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