summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/tut/tut.tex15
1 files changed, 15 insertions, 0 deletions
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex
index e6017b0..508a7ae 100644
--- a/Doc/tut/tut.tex
+++ b/Doc/tut/tut.tex
@@ -2162,6 +2162,21 @@ What is your quest? It is the holy grail.
What is your favorite color? It is blue.
\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}}