day2/day2quiz.tex
changeset 354 5dc6c3673f9d
parent 349 58366fe3839b
child 373 f04eca8b2f3d
--- a/day2/day2quiz.tex	Sun Jan 10 23:09:00 2010 +0530
+++ b/day2/day2quiz.tex	Tue Jan 12 19:03:34 2010 +0530
@@ -60,5 +60,127 @@
   \end{itemize}
 \end{frame}
 
+\begin{frame}
+\frametitle{\incqno }
+  What is the largest integer value that can be represented natively by Python?
+\end{frame}
+
+\begin{frame}
+\frametitle{\incqno }
+  What is the result of 17.0 / 2?
+\end{frame}
+
+\begin{frame}
+\frametitle{\incqno }
+  Which of the following is not a type in Python?
+  \begin{enumerate}
+    \item int
+    \item float
+    \item char
+    \item string
+  \end{enumerate}
+\end{frame}
+
+\begin{frame}
+\frametitle{\incqno }
+How do you create a complex number with real part 2 and imaginary part
+0.5.
+\end{frame}
+
+\begin{frame}
+\frametitle{\incqno }
+  What is the difference between \kwrd{print} \emph{x} and \kwrd{print} \emph{x,} ?
+\end{frame}
+
+\begin{frame}
+\frametitle{\incqno }
+  What does '*' * 40 produce?
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{\incqno }
+    What is the output of:
+    \begin{lstlisting}
+In []: ', '.join(['a', 'b', 'c'])
+    \end{lstlisting}
+\end{frame}
+
+
+\begin{frame}[fragile]
+    \frametitle{\incqno}
+  \begin{lstlisting}
+In []: 47 % 3 
+  \end{lstlisting}
+  What is the output?
+\end{frame}
+
+\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
+pIn []: 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}
+
+\begin{frame}
+    \frametitle{\incqno}
+  How many items can a function return?
+\end{frame}
+
 \end{document}