conditionals/quickref.tex
author anand
Tue, 16 Nov 2010 23:28:06 +0530
changeset 518 33ad94cee1fb
parent 439 b437ff7def95
permissions -rw-r--r--
checklist ok for `manipulating strings`

Writing an if/elif/else block:
\begin{lstlisting}
if condition1:
   # do A, B, C
elif condition2:
   # do D, E
else:
   # do Y, Z
\end{lstlisting}

The ternary operator:
{\ex \lstinline|    C if X else Y|} -- Do C if X is True else do Y.