In Python, what is the best way to compute the difference between two lists?

example

A = [1,2,3,4]
B = [2,5]

A - B = [1,3,4]
B - A = [5]

16 Answers
16

Tags:

Leave a Reply

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