I\'m trying to write a piece of code that can automatically factor an expression. For example, if I have two lists [1,2,3,4] and [2,3,5], the code should be able to find th
You can use the .__xor__ attribute method.
.__xor__
set([1,2,3,4]).__xor__(set([2,3,5]))
or
a = set([1,2,3,4]) b = set([2,3,5]) a.__xor__(b)