GNU Info

Info Node: (python2.1-ref.info)if statement

(python2.1-ref.info)if statement


Next: while statement Prev: Compound statements Up: Compound statements
Enter node , (file) or (file)node

The `if' statement
==================

The `if' statement is used for conditional execution:

     if_stmt:        "if" expression ":" suite
                    ("elif" expression ":" suite)*
                    ["else" ":" suite]

It selects exactly one of the suites by evaluating the expressions one
by one until one is found to be true (see section Note: Boolean
operations for the definition of true and false); then that suite is
executed (and no other part of the `if' statement is executed or
evaluated).  If all expressions are false, the suite of the `else'
clause, if present, is executed.


automatically generated by info2www version 1.2.2.9