I would say that this is because the "operand" && is "ANDING" the numbers. Therefore the response the the line print 1 && 1 && 0; would be a 0. Since the line is a "mathematical string" it is performed left to right (1 && 1 = 1, 1 && 0 = 0).
Hope this helps. Have a great day; Andy Mark Anderson wrote: > > Basic question on using '&&' vs 'and'. I see that '&&' has higher > precedence > > than 'and', but why does > > > > print 1 && 1 && 0; > > print "\n"; > > print 1 and 1 and 0; > > print "\n"; > > > > return > > 0 > > 1 > > > > I would have expected both statements to return 0. > > >From a couple of experiments, I would guess that "print" has higher > precedence than "and". > > print 1 and print 0; > > prints both in order, it doesn't "and" the 1 from printing 0 to the literal > 1 to print 01 as you get with > > print 1 && print 0; > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED]