BTW: If you want the second case, only, you can write: >>> from operator import xor >>> a = [0, 1, 2] >>> b = [1, 2, 3] >>> [item for item in a + b if xor(item in a, item in b)] [0, 3] -- Frank Buß, fb at frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de