(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/16/ref/while.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/16/ref/compound.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/16/ref/compound.html| ]]
|
Python Reference Manual
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/16/ref/contents.html| ]]
|
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/16/ref/genindex.html| ]]
|
Next: 7.2 The while statement Up: 7. Compound statements Previous: 7. Compound statements
7.1 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 5.10 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.
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/16/ref/while.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/16/ref/compound.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/16/ref/compound.html| ]]
|
Python Reference Manual
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/16/ref/contents.html| ]]
|
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/16/ref/genindex.html| ]]
|
Next: 7.2 The while statement Up: 7. Compound statements Previous: 7. Compound statements