diff options
author | Fred Drake <fdrake@acm.org> | 1998-11-30 20:37:24 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1998-11-30 20:37:24 (GMT) |
commit | f790b16d00e488026aa74b45624f7faed2c7510d (patch) | |
tree | 0f7486e1ba0de22f36377f9ba11b555e6de37c77 /Doc/tut | |
parent | ca6d6355d753d65d364a02697b92ed6684e44475 (diff) | |
download | cpython-f790b16d00e488026aa74b45624f7faed2c7510d.zip cpython-f790b16d00e488026aa74b45624f7faed2c7510d.tar.gz cpython-f790b16d00e488026aa74b45624f7faed2c7510d.tar.bz2 |
Change "for" explanation slightly based on comment passed along by
Blake Winton <BlakeW@pcdocs.com>.
Diffstat (limited to 'Doc/tut')
-rw-r--r-- | Doc/tut/tut.tex | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex index 2d758ae..7171c6f 100644 --- a/Doc/tut/tut.tex +++ b/Doc/tut/tut.tex @@ -878,13 +878,16 @@ if', and is useful to avoid excessive indentation. An \section{\keyword{for} Statements \label{for}} -The \keyword{for} statement in Python differs a bit from what you may be -used to in \C{} or Pascal. Rather than always iterating over an -arithmetic progression of numbers (like in Pascal), or leaving the user -completely free in the iteration test and step (as \C{}), Python's -\keyword{for} statement iterates over the items of any sequence (e.g., a -list or a string), in the order that they appear in the sequence. For -example (no pun intended): +The \keyword{for}\stindex{for} statement in Python differs a bit from +what you may be used to in \C{} or Pascal. Rather than always +iterating over an arithmetic progression of numbers (like in Pascal), +or giving the user the ability to define both the iteration step and +halting condition (as \C{}), Python's \keyword{for}\stindex{for} +statement iterates over the items of any sequence (e.g., a list or a +string), in the order that they appear in the sequence. For example +(no pun intended): +% One suggestion was to give a real C example here, but that may only +% serve to confuse non-C programmers. \begin{verbatim} >>> # Measure some strings: |