diff options
Diffstat (limited to 'day1/session2.tex')
-rw-r--r-- | day1/session2.tex | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/day1/session2.tex b/day1/session2.tex index 12dbb58..a845d98 100644 --- a/day1/session2.tex +++ b/day1/session2.tex @@ -479,3 +479,47 @@ plot(l, tsq, '.') \end{frame} \end{document} + +%% Questions for Quiz %% +%% ------------------ %% + +\begin{frame}[fragile] +\frametitle{\incqno } + \begin{lstlisting} + In []: a = [1, 2, 5, 9] + In []: a[0:-1] + \end{lstlisting} + What is the output? +\end{frame} + +\begin{frame} +\frametitle{\incqno } + How do you combine two lists \emph{a} and \emph{b} to produce one list? +\end{frame} + +\begin{frame}[fragile] +\frametitle{\incqno } + \begin{lstlisting} + In []: a = [1, 2, 5, 9] + \end{lstlisting} + How do you add the value 10 to the end of this list? +\end{frame} + +\begin{frame} +\frametitle{\incqno } +Write the code to read a file \texttt{data.txt} and print each line of it? +\end{frame} + +\begin{frame}[fragile] +\frametitle{\incqno } +The following code snippet has an error/bug: +\begin{lstlisting} +In []: l = [0.1, 0.2, 0.3, 0.4] +In []: t = [0.69, 0.90, 1.19, 1.30] +In []: tsq = [] +In []: for time in t: + ....: tsq.append(time*time) + ....: plot(l, tsq) +\end{lstlisting} +What is the error? How do you fix it? +\end{frame} |