diff options
author | Puneeth Chaganti | 2010-01-12 19:03:34 +0530 |
---|---|---|
committer | Puneeth Chaganti | 2010-01-12 19:03:34 +0530 |
commit | e7c314cb1d20800f929951eeac75e046528a36c8 (patch) | |
tree | 1aa4fed41387bb6e82a0cd5662eb5ad2891a6e7d /day2/day2quiz.tex | |
parent | ff739ac283432d46ae2c3b527d1999cd24029b86 (diff) | |
download | workshops-e7c314cb1d20800f929951eeac75e046528a36c8.tar.gz workshops-e7c314cb1d20800f929951eeac75e046528a36c8.tar.bz2 workshops-e7c314cb1d20800f929951eeac75e046528a36c8.zip |
Changes made during REC Chennai workshop.
Diffstat (limited to 'day2/day2quiz.tex')
-rwxr-xr-x | day2/day2quiz.tex | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/day2/day2quiz.tex b/day2/day2quiz.tex index badefbc..5561d3d 100755 --- a/day2/day2quiz.tex +++ b/day2/day2quiz.tex @@ -60,5 +60,127 @@ On the top right hand corner please write down the following: \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} |