Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6ed33a

Browse files
committed
fix minor markup error: \code{for} --> \keyword{for}
1 parent b1e5b50 commit e6ed33a

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Doc/tut/tut.tex

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4286,7 +4286,7 @@ \section{Exceptions Are Classes Too\label{exceptionClasses}}
42864286
\section{Iterators\label{iterators}}
42874287
42884288
By now, you've probably noticed that most container objects can be looped
4289-
over using a \code{for} statement:
4289+
over using a \keyword{for} statement:
42904290
42914291
\begin{verbatim}
42924292
for element in [1, 2, 3]:
@@ -4302,11 +4302,12 @@ \section{Iterators\label{iterators}}
43024302
\end{verbatim}
43034303
43044304
This style of access is clear, concise, and convenient. The use of iterators
4305-
pervades and unifies Python. Behind the scenes, the \code{for} statement calls
4306-
\function{iter()} on the container object. The function returns an iterator
4307-
object that defines the method \method{next()} which accesses elements in the
4308-
container one at a time. When there are no more elements, \method{next()}
4309-
raises a \exception{StopIteration} exception which tells the \code{for} loop
4305+
pervades and unifies Python. Behind the scenes, the \keyword{for}
4306+
statement calls \function{iter()} on the container object. The
4307+
function returns an iterator object that defines the method
4308+
\method{next()} which accesses elements in the container one at a
4309+
time. When there are no more elements, \method{next()} raises a
4310+
\exception{StopIteration} exception which tells the \keyword{for} loop
43104311
to terminate. This example shows how it all works:
43114312
43124313
\begin{verbatim}

0 commit comments

Comments
 (0)