compound conditional statements
sholden at holdenweb.com
Tue Sep 16 01:12:14 CEST 2003
<beliavsky at aol.com> wrote ...
> If I have code
> if (aa or bb): print "true",
> does Python evaluate aa and bb in any particular order? Can I assume that
> aa is true, bb will not be evaluated?
Yes. Both "and" and "or" are specifcally short-circuiting.
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/pwp/
More information about the Python-list