On Jul 10, 12:07 pm, ssecorp <[EMAIL PROTECTED]> wrote: > pair1 = (student1,student2) > pair2 = (student2,student1) > if (pair1 or pair2) in incompatibles:
Apart from the problems that others have mentioned, the above statement is NOT doing what you think it is. (pair1 or pair2) will always produce pair1, because pair1, a tuple of length 2, cannot be false. So the statement is equivalent to: if pair1 in incompatibles: What you want is: if pair1 in incompatibles or pair2 in incompatibles: Cheers, John -- http://mail.python.org/mailman/listinfo/python-list