conditionals/quickref.tex
author bhanu
Thu, 11 Nov 2010 02:16:07 +0530
changeset 477 0406115dccd1
parent 439 b437ff7def95
permissions -rw-r--r--
language check done for `matrices`

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.