conditionals/quickref.tex
author anand
Mon, 15 Nov 2010 15:49:26 +0530
changeset 514 ca9d084d0c87
parent 439 b437ff7def95
permissions -rw-r--r--
checklist ok for `getting started with 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.