[EMAIL PROTECTED] writes: > Lists say I have the following tuple - > t1 = ("ONE","THREE","SIX") > t2 = ("ONE","TWO","THREE") > t3 = ("TWO","FOUR","FIVE","SIX") > t4 = ("TWO",) > t5 = ("TWO","FIVE") > > What I want to do is return true if any member of tuple t1 is found in > the remaining tuples.
Convert them into sets and use the set intersection (&) operator, then convert to bool to represent whether the intersection is empty. print bool(set(t1) & set(t2)) print bool(set(t1) & set(t3)) print bool(set(t1) & set(t4)) print bool(set(t1) & set(t5)) -- http://mail.python.org/mailman/listinfo/python-list