Structured
statements are built from other statements. Use a structured statement when you
want to execute other statements sequentially, conditionally, or repeatedly.
· A compound or with statement simply executes a sequence of
constituent statements.
· A conditional statement, that is, an if or case
statement executes at most one of its constituents, depending on specified
criteria.
· Loop statements including repeat, while, and for
loops execute a sequence of constituent statements repeatedly.
· A special group of statements including raise, try...except, and try...finally constructions create and handle exceptions. For information about exception generation and handling, see Exceptions.
结构语句由其他语句建立而来。当要顺序、有条件或重复执行其他语句时,可以适用结构语句。
· 混合语句或with语句只是简单地执行结构语句中构成语句的序列。
· 条件语句如if或case语句,根据指定的条件,最多执行结构语句中的构成语句之一。
· 循环语句包括epeat、while和for语句,重复地循环执行结构语句中构成语句的序列。
· 特殊语句组如raise、try...except和try...finally等,其结构创建和处理了异常(exceptions)。有关异常产生和处理的信息,见异常。