loops/quickref.tex
author Puneeth Chaganti <punchagan@fossee.in>
Tue, 09 Nov 2010 15:33:47 +0530
changeset 413 da1f270b07b7
parent 285 7c4855fb8e5f
permissions -rw-r--r--
Change to progress.org

\textbf{loops}

To iterate over a sequence: \lstinline|for i in sequence:|\\
\texttt{i} is the looping variable. 

To iterate while a condition is true: \lstinline|while condition:|

Blocks in python are indented. To end block return to the previous
indentation. 

To break out of the innermost loop: \lstinline|break|

To skip to end of current iteration: \lstinline|continue|

\lstinline|pass| is just a syntactic filler.