quiz.tex
author Madhusudan.C.S <madhusudancs@gmail.com>
Fri, 09 Oct 2009 12:59:55 +0530
changeset 86 f657495cf8b2
parent 85 8ca53181bee6
child 89 98ebba820e91
permissions -rw-r--r--
Final set of changes.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
86
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
     1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
     2
% Tutorial slides on Python.
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
     3
%
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
     4
% Author: FOSSEE <info at fossee  dot in>
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
     5
% Copyright (c) 2005-2009, FOSSEE Team
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
     6
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
     7
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
     8
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
     9
\documentclass[14pt,compress]{beamer}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    10
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    11
\mode<presentation>
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    12
{
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    13
  \useoutertheme{split}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    14
  \setbeamercovered{transparent}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    15
}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    16
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    17
\definecolor{darkgreen}{rgb}{0,0.5,0}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    18
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    19
\usepackage{listings}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    20
\lstset{language=Python,
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    21
    basicstyle=\ttfamily\bfseries,
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    22
    commentstyle=\color{red}\itshape,
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    23
  stringstyle=\color{darkgreen},
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    24
  showstringspaces=false,
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    25
  keywordstyle=\color{blue}\bfseries}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    26
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    27
\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}}  }
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    28
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    29
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    30
% Title page
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    31
\title[Basic Python]{Python: Quiz}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    32
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    33
\author[FOSSEE Team] {FOSSEE Authors}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    34
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    35
\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    36
\date[] {11, October 2009\\Day 1, Session 0}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    37
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    38
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    39
333092b68926 Added quiz tex file and all exercise problems Madhu worked out.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    40
\begin{document}
86
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    41
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    42
\begin{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    43
  \titlepage
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    44
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    45
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    46
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    47
  What is the biggest integer number that can be represented by Python?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    48
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    49
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    50
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    51
  What is the result of 17.0 / 2?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    52
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    53
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    54
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    55
  What does '*' * 40 produce?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    56
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    57
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    58
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    59
  Which of the following is not a type in Python?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    60
  \begin{enumerate}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    61
    \item int
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    62
    \item float
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    63
    \item char
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    64
    \item string
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    65
  \end{enumerate}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    66
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    67
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    68
\begin{frame}[fragile]{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    69
  What happens when we run this code?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    70
  \begin{lstlisting}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    71
a = False
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    72
b = True
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    73
c = True
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    74
if a and b or c:
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    75
    print "You are correct!"
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    76
  \end{lstlisting}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    77
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    78
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    79
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    80
  What is the difference between print x and print x, ?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    81
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    82
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    83
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    84
  A single line of CSV file should be separated into fields. What method would you use to achieve this?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    85
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    86
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    87
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    88
  How many items can a function return?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    89
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    90
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    91
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    92
  If function returns more than one item/object what is the return type of the function?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    93
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    94
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    95
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    96
  Given a list a, what will its slice a[:-1] evaluate to?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    97
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    98
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
    99
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   100
  How do you get a slice of the list where the slice has only alternate elements?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   101
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   102
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   103
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   104
  How do you combine 2 lists?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   105
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   106
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   107
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   108
  How do you find the presence of a given element in the list?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   109
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   110
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   111
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   112
  You are given a tuple a = (1, 2, 5, 7). What is the result of a[1] = 3?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   113
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   114
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   115
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   116
  We use \kwrd{for} to loop through the elements of a list. What do we have to do if we want to iterate through the elements of a list as well as get the index of the elements of the list as we iterate through?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   117
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   118
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   119
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   120
  What is the difference between import math and from math import *?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   121
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   122
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   123
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   124
  What can be the keys of a dictionary?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   125
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   126
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   127
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   128
  What happens when you try to access a key in the dictionary that does not exist?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   129
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   130
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   131
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   132
  How do you avoid such an exception?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   133
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   134
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   135
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   136
  How do you obtain all the keys of the dictionary?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   137
  \pause
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   138
  \\all the values?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   139
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   140
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   141
\begin{frame}{}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   142
  What will the set contain when you create a set from a list containing duplicate elements?
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   143
\end{frame}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   144
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   145
\end{document}
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   146
85
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   147
\begin{enumerate}
86
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   148
  \item Which version of Python were you using?
85
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   149
  \item List some key differences between IPython and Vanilla Python
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   150
  \item What is the biggest integer number that can be represented by Python?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   151
  \item What is the result of 17.0 / 2?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   152
  \item What does '*' * 40 produce?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   153
  \item List all the basic types available in Python.
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   154
  \item What happens when we run this code?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   155
  a = False
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   156
  b = True
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   157
  c = True
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   158
  if a and b or c:
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   159
      print ``You are correct!''
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   160
  \item Select last 3 alternative elements in any given list.
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   161
  \item Give the difference between print x and print x,
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   162
  \item A single line of CSV file should be separated into fields. What method would you use to achieve this?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   163
  \item How many items can a function return?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   164
  \item If function returns more than one item/object what is the return type of the function?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   165
  \item How do you document a function?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   166
  \item Given a list l, what will its slice l[:-1] evaluate to?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   167
  \item How do you get a slice of the list where the slice has only alternate elements?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   168
  \item How do you add another list at the end of a given list?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   169
  \item How do you find if a given element is present in the list or not?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   170
  \item You are given a tuple a = (1, 2, 5, 7). What happens when you do a[1] = 3?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   171
  \item We use for to loop through the list elements. What do we have to do if we want to iterate through the elements of the list as well as get the index of the elements of the list as we iterate through?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   172
  \item What is the difference between import math and from math import *?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   173
  \item List at least 5 Standard Library Modules.
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   174
  \item How do you create a Python module of your own?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   175
  \item What can be the keys of a dictionary?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   176
  \item What happens when you try to access a key in the dictionary that does not exist?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   177
  \item How do you avoid such an exception?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   178
  \item How do you obtain all the keys of the dictionary?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   179
  \item How do you obtain all the values of the dictionary?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   180
  \item What will the set contain when you create a set from a list containing duplicate elements?
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   181
  \item Name any 2 types of Exception.
8ca53181bee6 Added quiz questions.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 64
diff changeset
   182
  \item Whats are the 2 IPython command you use for debugging?
86
f657495cf8b2 Final set of changes.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 85
diff changeset
   183
\end{enumerate}