diff options
author | Puneeth Chaganti | 2010-01-10 16:57:51 +0530 |
---|---|---|
committer | Puneeth Chaganti | 2010-01-10 16:57:51 +0530 |
commit | 71b470de4c5b6dee3e59efd9d94d188e74622772 (patch) | |
tree | 2b7425f5277941915706e732ddd0d6cb608fb808 /day2/session2.tex | |
parent | 268a25c7e1721e7a0c51080dd128b68d0ad3a4d5 (diff) | |
download | workshops-more-scipy-71b470de4c5b6dee3e59efd9d94d188e74622772.tar.gz workshops-more-scipy-71b470de4c5b6dee3e59efd9d94d188e74622772.tar.bz2 workshops-more-scipy-71b470de4c5b6dee3e59efd9d94d188e74622772.zip |
Moved all day2 quiz questions to end of day2-sessions.
Diffstat (limited to 'day2/session2.tex')
-rw-r--r-- | day2/session2.tex | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/day2/session2.tex b/day2/session2.tex index d40f9d2..c64ca87 100644 --- a/day2/session2.tex +++ b/day2/session2.tex @@ -536,3 +536,70 @@ def what( n ): \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} + |