One parameter is left untouched - subtraction:
>>> {1, 2} - {1, 2, 3} set([]) >>> {1, 2, 3} - {1, 2} set([3])
Basically you check which items in the first list are not in the second list.
It was very convenient for me, since you could show which values ββare missing:
>>> def check_contains(a, b): ... diff = a - b ... if not diff: ...
Artem Skoretskiy Apr 13 '16 at 12:42 on 2016-04-13 12:42
source share