[Python-checkins] python/dist/src/Doc/tut tut.tex,1.209,1.210

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Thu Nov 6 20:31:00 EST 2003


Update of /cvsroot/python/python/dist/src/Doc/tut
In directory sc8-pr-cvs1:/tmp/cvs-serv24004

Modified Files:
	tut.tex 
Log Message:
Add a new looping idiom

Index: tut.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v
retrieving revision 1.209
retrieving revision 1.210
diff -C2 -d -r1.209 -r1.210
*** tut.tex	25 Oct 2003 14:15:54 -0000	1.209
--- tut.tex	7 Nov 2003 01:30:58 -0000	1.210
***************
*** 2163,2166 ****
--- 2163,2181 ----
  \end{verbatim}
  
+ To loop over a sequence in reverse, first specify the sequence
+ in a forward direction and then call the \function{reversed()}
+ function.
+ 
+ \begin{verbatim}
+ >>> for i in reversed(xrange(1,10,2)):
+ ...     print i
+ ...
+ 9
+ 7
+ 5
+ 3
+ 1
+ \end{verbatim}
+ 
  
  \section{More on Conditions \label{conditions}}





More information about the Python-checkins mailing list