Original Translation
5
if test1: if test2: print(x)
6
Also note that the semicolon binds tighter than the colon in this context, so that in the following example, either all or none of the :func:`print` calls are executed::
7
if x < y < z: print(x); print(y); print(z)
8
Summarizing:
9
Note that statements always end in a ``NEWLINE`` possibly followed by a ``DEDENT``. Also note that optional continuation clauses always begin with a keyword that cannot start a statement, thus there are no ambiguities (the 'dangling :keyword:`else`' problem is solved in Python by requiring nested :keyword:`if` statements to be indented).
10
The formatting of the grammar rules in the following sections places each clause on a separate line for clarity.
11
The :keyword:`if` statement
12
The :keyword:`if` statement is used for conditional execution:
13
It selects exactly one of the suites by evaluating the expressions one by one until one is found to be true (see section :ref:`booleans` for the definition of true and false); then that suite is executed (and no other part of the :keyword:`if` statement is executed or evaluated). If all expressions are false, the suite of the :keyword:`else` clause, if present, is executed.
14
The :keyword:`while` statement