On 2007-02-08, Paul Rubin <http> wrote: > [EMAIL PROTECTED] writes: >> if cond1: >> if cond2: >> do_something. > > You can write: > if cond1 and cond2: > do_something > >> if cond1 OR if cond2: >> do_something. > > if cond1 or cond2: > do_something > >> I've tried using the C syntax for OR (||) but python complained. I'm sure >> there's a way to do this rather than using if cond1: elif cond2: both with >> the same code to execute. > > Python uses the "and" and "or" keywords for && and ||.
Allow me to thank all of you who responded with this one article. For whatever reason, it did not occur to me to use the words 'and' and 'or.' And, I did not see this in the tutorial or introduction ... which is my fault. So, I do thank all of you. Rich -- http://mail.python.org/mailman/listinfo/python-list