diff options
Diffstat (limited to 'day1/session3.tex')
-rw-r--r-- | day1/session3.tex | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/day1/session3.tex b/day1/session3.tex index c769fe5..2de2634 100644 --- a/day1/session3.tex +++ b/day1/session3.tex @@ -453,3 +453,85 @@ print 'Standard Deviation: ', \end{frame} \end{document} + +%% Questions for Quiz %% +%% ------------------ %% + +\begin{frame} +\frametitle{\incqno } + A sample line from a Comma Separated Values (CSV) file:\\ + \vspace*{0.2in} + \emph{Rossum, Guido, 42, 56, 34, 54}\\ + \vspace*{0.2in} + What code would you use to separate the line into fields? +\end{frame} + +\begin{frame}[fragile] +\frametitle{\incqno } + \begin{lstlisting} + In []: a = [1, 2, 5, 9] + \end{lstlisting} + How do you find the length of this list? +\end{frame} + +\begin{frame}[fragile] +\frametitle{\incqno } + \begin{lstlisting} + In [1]: d = { + 'a': 1, + 'b': 2 + } + In [2]: print d['c'] + \end{lstlisting} + What is the output? +\end{frame} + +\begin{frame}[fragile] +\frametitle{\incqno } +\begin{lstlisting} +In []: sc = {'A': 10, 'B': 20, + 'C': 70} +\end{lstlisting} +Given the above dictionary, what command will you give to plot a +pie-chart? +\end{frame} + +\begin{frame}[fragile] +\frametitle{\incqno } +\begin{lstlisting} +In []: marks = [10, 20, 30, 50, 55, + 75, 83] +\end{lstlisting} +Given the above marks, how will you calculate the \alert{mean} and +\alert{standard deviation}? +\end{frame} + +\begin{frame}[fragile] +\frametitle{\incqno } +\begin{lstlisting} +In []: marks = [10, 20, 30, 50, 55, + 75, 83] +\end{lstlisting} +How will you convert the list \texttt{marks} to an \alert{array}? +\end{frame} + +%% \begin{frame}[fragile] +%% \frametitle{\incqno } +%% \begin{lstlisting} +%% for x in "abcd": +%% print x + +%% a +%% b +%% c +%% d +%% \end{lstlisting} +%% How do you get the following output? +%% \begin{lstlisting} +%% 0 a +%% 1 b +%% 2 c +%% 3 d +%% \end{lstlisting} +%% \end{frame} + |