Re: [Tutor] the and command

2007-08-24 Thread Kent Johnson
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

Re: [Tutor] the and command

2007-08-24 Thread Ricardo Aráoz
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 th

Re: [Tutor] the and command

2007-08-24 Thread Mike Hansen
> -Original Message- > ... > > for num in l2: > > if num in l3 and num in l4 and num in l5 and num in l6: > > possible.append(num) Yikes! Glancing at the code, I was reading l3, l4, l5, l6 as the numbers 13, 14, 15, 16..(Thirteen, Fourteen, Fifteen, Sixteen). I'd avoid us

Re: [Tutor] the and command

2007-08-24 Thread Kent Johnson
max baseman wrote: > thanks much you really helped me if anyone wants here is the program: Hmmm...this is quite wordy. Some suggestions below: > > n2=2 > n3=3 > n4=4 > n5=5 > n6=6 > n7=7 > l2=[] > l3=[] > l4=[] > l5=[] > l6=[] > l7=[] > while n2 < 1000: > l2.append(n2) > n2=n2+2 This c

Re: [Tutor] the and command

2007-08-24 Thread max baseman
thanks much you really helped me if anyone wants here is the program: n2=2 n3=3 n4=4 n5=5 n6=6 n7=7 l2=[] l3=[] l4=[] l5=[] l6=[] l7=[] while n2 < 1000: l2.append(n2) n2=n2+2 while n3 < 1000: l3.append(n3) n3=n3+3 while n4 < 1000: l4.append(n4) n4=n4+4 while n5 < 1000

Re: [Tutor] the and command

2007-08-24 Thread Alan Gauld
"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 nu

[Tutor] the and command

2007-08-23 Thread max baseman
hello 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, here is the program it's choppy i needed it for a quick calculation so it's not pretty but it's not long: n2=2 n3=3 n4=4 n5=5 n6=6 n