Ricardo Aráoz wrote: > Alan Gauld wrote: >> "max baseman" <[EMAIL PROTECTED]> wrote >>> im checking if a number is in all 5 of the other lists and when >>> i use the and command it seems to just be checking if it's in a >>> least >>> one of the others, >> >>> for num in l2 and l3 and l4 and l5 and l6: # here seems to be the >> Try: >> >> if num in I2 and num in I3 and num in I4 and num in I5 and num in I6: >> > > or also : if num in l1 + l2 + l3 + l4 + l5 :
No, that has a different meaning, it is true if num is in *any* of the lists; the original version requires num to be in *all* of the lists. Also your version will compute the sum of lists every time through the loop which you don't really want... Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor