conditionals/quickref.tex
author anand
Fri, 12 Nov 2010 00:40:47 +0530
changeset 491 ebfe3a675882
parent 439 b437ff7def95
permissions -rw-r--r--
checklist ok for `getting started with lists`

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.