Yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/boolean.html

From ZCubes Wiki
Revision as of 19:41, 7 November 2013 by MassBot1 (talk | contribs) (Created page with "<div class="navigation"> {| width="100%" cellspacing="2" align="center" | yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/truth.html|[[Image:yurttas_PL_SL_...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


2.1.2 Boolean Operations

These are the Boolean operations, ordered by ascending priority:

Operation Result Notes x or y

if x is false, then y, else x

(1)
x and y

if x is false, then x, else y

(1)
not x

if x is false, then 1, else 0

(2)

Notes:

(1)
These only evaluate their second argument if needed for their outcome.
(2)
"not" has a lower priority than non-Boolean operators, so not a == b is interpreted as not (a == b), and a == not b is a syntax error.

See About this document... for information on suggesting changes.