GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing docs.python.org — 7.1 The if statement

Previous Page Up One Level Next Page Python Reference Manual Contents Index
Previous: 7. Compound statements Up: 7. Compound statements Next: 7.2 The while statement


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 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.


Previous Page Up One Level Next Page Python Reference Manual Contents Index
Previous: 7. Compound statements Up: 7. Compound statements Next: 7.2 The while statement

See About this document... for information on suggesting changes.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.