diff -r adb85e126341 -r 19754ed6050f day2/session2.tex --- a/day2/session2.tex Sun Jan 10 16:43:15 2010 +0530 +++ b/day2/session2.tex Sun Jan 10 16:57:51 2010 +0530 @@ -536,3 +536,70 @@ \end{frame} \end{document} + +%% Questions for Quiz %% +%% ------------------ %% + +\begin{frame} + \frametitle{\incqno} + How do you find the presence of an element \emph{x} in the list \emph{a}? +\end{frame} + + +\begin{frame}[fragile] + \frametitle{\incqno} + \begin{lstlisting} +In []: set([1, 2, 8, 2, 13, 8, 9]) + \end{lstlisting} + What is the output? +\end{frame} + +\begin{frame}[fragile] + \frametitle{\incqno} + \begin{lstlisting} +In []: a = {'a': 1, 'b': 2} +In []: a['a'] = 10 +In []: print a + \end{lstlisting} + What is the output? +\end{frame} + +\begin{frame}[fragile] + \frametitle{\incqno} + \begin{lstlisting} +In []: for i in range(3, 10, 2): + ...: print i + \end{lstlisting} + What is the output? +\end{frame} + +\begin{frame}[fragile] + \frametitle{\incqno} + \begin{lstlisting} +In []: a = [1, 2, 3] +In []: a.extend([5, 6]) + \end{lstlisting} + What is the value of a? +\end{frame} + +\begin{frame}[fragile] + \frametitle{\incqno} + \begin{lstlisting} +In []: a = (1, 2, 3) +In []: a[1] = 10 + \end{lstlisting} + What is the result? +\end{frame} + +\begin{frame}[fragile] + \frametitle{\incqno} + \begin{lstlisting} +def func(x, y=10): + print x+1, y+10 + +func(1) + + \end{lstlisting} + What is the output? +\end{frame} +