conditionals/quickref.tex
author anand
Thu, 11 Nov 2010 00:24:11 +0530
changeset 474 f137f3e036d9
parent 439 b437ff7def95
permissions -rw-r--r--
checklist OK for `gettin started with for loops` 1;2305;0c

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.