I am trying to find the difference between 2 lists. Basically, I want to know everything that is in list 1 that is not in list 2. The best way to explain it, is with an example:
List1 = [a, a, b, c, d, e]
List2 = [a, b, c, d]
In this example, I would like a function that would return [a, e]
When I use the difference function in python, it will only return “e” and not that there is an additional “a” that is in list 1. When I simply used XOR between the 2 lists, it also only returned “e.”
What you want is really not set subtraction. You can use a Counter: