[EMAIL PROTECTED] kirjoitti: > Hi, > > Lists say I have the following tuple - > > t1 = ("ONE","THREE","SIX") > > and then the following tuples - > > 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. > > Therefore - > > 2) ("ONE","TWO","THREE") : TRUE > > 3) ("TWO","FOUR","FIVE","SIX") : TRUE > > 4) ("TWO",) FALSE > > 5) ("TWO","FIVE") > > How do I do this? > > Cheers, > > Barry. >
Another variation of the theme: #==================== for t in (t2, t3, t4, t5): for x in t1: if x in t: print True break else: print False #==================== HTH, Jussi -- http://mail.python.org/mailman/listinfo/python-list