File tree 1 file changed +10
-10
lines changed
text/main/controlFlow/conditionals
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 12
12
if booleanExpression:
13
13
conditional statement 1
14
14
conditional statement 2
15
- ...
15
+ # ...
16
16
17
17
normal statement 1
18
18
normal statement 2
19
- ...
19
+ # ...
20
20
\end {pythonSyntax }
21
21
%
22
22
The first line begins with \pythonilIdx {if}~statement, followed by a Boolean expression, followed by a colon~(\pythonilIdx {:}).
76
76
if booleanExpression:
77
77
conditional statement 1
78
78
conditional statement 2
79
- ...
79
+ # ...
80
80
else:
81
81
alternative statement 1
82
82
alternative statement 2
83
- ...
83
+ # ...
84
84
85
85
normal statement 1
86
86
normal statement 2
87
- ...
87
+ # ...
88
88
\end {pythonSyntax }
89
89
%
90
90
The statement begins like a normal \pythonilIdx {if}~statement:
148
148
if booleanExpression 1:
149
149
conditional 1 statement 1
150
150
conditional 2 statement 2
151
- ...
151
+ # ...
152
152
elif booleanExpression 2: # such block can be placed arbitrarily often
153
153
conditional 2 statement 1
154
154
conditional 2 statement 2
155
- ...
155
+ # ...
156
156
elif booleanExpression 3: # this is of course optional
157
157
conditional 3 statement 1
158
158
conditional 3 statement 2
159
- ...
159
+ # ...
160
160
else: # this, too, is optional
161
161
alternative statement 1
162
162
alternative statement 2
163
- ...
163
+ # ...
164
164
165
165
normal statement 1
166
166
normal statement 2
167
- ...
167
+ # ...
168
168
\end {pythonSyntax }
169
169
%
170
170
Notice that we can use arbitrarily many \pythonils {elif}\pythonIdx {elif} and, optionally, one~\pythonilIdx {else}.
You can’t perform that action at this time.
0 commit comments