Repository navigation
Commit f6f18ea
committed
Improve explanation of (for|while)-else in tutorial
- Remove the sentence that sparked some confusion, which starts
"As the loop executes ..."
- The opening of "else Clauses on Loops" now states that the `else`
is paired with the `for` or `while` loop keyword, not with an
internal `break` -- this small change better prepares readers for the
possibility of `while-else` and `for-else` without a `break` (which is
rare but valid).
- The final paragraph of this doc section has been reworded, so that it
is clear that it, and the section above it, are both analogies which
can help readers understand `for-else` and `while-else`. The precise
rules for what the `else` clause does are properly stated above.1 parent 846acf1 commit f6f18ea
1 file changed
Lines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | | - | |
206 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
243 | | - | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
| |||
0 commit comments