quiz-day2.tex
author Madhusudan.C.S <madhusudancs@gmail.com>
Mon, 26 Oct 2009 12:42:53 +0530
changeset 167 5f13be28532d
parent 104 896f96b9de3b
permissions -rw-r--r--
Merged Puneeth and Madhu branches.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
104
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     2
% Tutorial slides on Python.
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     3
%
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     4
% Author: FOSSEE <info at fossee  dot in>
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     5
% Copyright (c) 2005-2009, FOSSEE Team
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     6
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     7
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     8
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     9
\documentclass[14pt,compress]{beamer}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    10
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    11
\mode<presentation>
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    12
{
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    13
  \useoutertheme{split}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    14
  \setbeamercovered{transparent}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    15
}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    16
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    17
\definecolor{darkgreen}{rgb}{0,0.5,0}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    18
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    19
\usepackage{listings}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    20
\lstset{language=Python,
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    21
    basicstyle=\ttfamily\bfseries,
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    22
    commentstyle=\color{red}\itshape,
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    23
  stringstyle=\color{darkgreen},
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    24
  showstringspaces=false,
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    25
  keywordstyle=\color{blue}\bfseries}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    26
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    27
\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}}  }
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    28
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    29
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    30
% Macros
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    31
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    32
\newcounter{qno}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    33
\setcounter{qno}{0}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    34
\newcommand{\incqno}{\addtocounter{qno}{1}{Question \theqno}}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    35
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    36
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    37
% Title page
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    38
\title[Basic Python]{Python: Quiz}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    39
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    40
\author[FOSSEE Team] {FOSSEE}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    41
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    42
\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    43
\date[] {11, October 2009\\Day 2}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    44
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    45
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    46
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    47
\begin{document}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    48
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    49
\begin{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    50
  \titlepage
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    51
\end{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    52
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    53
\begin{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    54
  \frametitle{Write your details...}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    55
On the top right hand corner please write down the following:
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    56
  \begin{itemize}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    57
    \item  Name:
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    58
    \item Affliation:
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    59
    \item Occupation:
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    60
  \end{itemize}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    61
\end{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    62
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    63
\begin{frame}[fragile]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    64
\frametitle{\incqno }
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    65
\begin{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    66
  >>> x = array([[1,2,3,4],[3,4,2,5]])
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    67
  >>> x.shape
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    68
  (2, 4)
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    69
\end{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    70
Change the shape of \lstinline+x+ to (4,2)
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    71
\end{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    72
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    73
\begin{frame}[fragile]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    74
\frametitle{\incqno }
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    75
\begin{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    76
  >>> x = array([[1,2,3,4]])
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    77
\end{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    78
How to change the third element of \lstinline+x+ to 0?
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    79
\end{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    80
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    81
\begin{frame}[fragile]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    82
\frametitle{\incqno }
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    83
What would be the result?
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    84
\begin{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    85
  >>> y = arange(3)
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    86
  >>> x = linspace(0,3,3)
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    87
  >>> x-y
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    88
\end{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    89
\end{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    90
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    91
\begin{frame}[fragile]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    92
\frametitle{\incqno }
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    93
\begin{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    94
  >>> x = array([0, 1, 2, 3])
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    95
  >>> x.shape = 2,2
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    96
  >>> x
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    97
  array([[0, 1],
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    98
         [2, 3]])
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    99
  >>> x[::2,::2]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   100
\end{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   101
What is the output?
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   102
\end{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   103
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   104
\begin{frame}[fragile]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   105
\frametitle{\incqno }
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   106
What would be the result?
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   107
\begin{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   108
  >>> x
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   109
  array([[0, 1, 2],
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   110
         [3, 4, 5],
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   111
         [6, 7, 8]])
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   112
  >>> x[::-1,:]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   113
\end{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   114
Hint:
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   115
\begin{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   116
  >>> x = arange(9)
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   117
  >>> x[::-1]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   118
  array([8, 7, 6, 5, 4, 3, 2, 1, 0])
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   119
\end{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   120
\end{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   121
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   122
\begin{frame}[fragile]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   123
\frametitle{\incqno }
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   124
\begin{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   125
  >>> x
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   126
  array([[ 0, 1, 2, 3],
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   127
         [ 4, 5, 6, 7],
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   128
         [ 8, 9, 10, 11],
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   129
         [12, 13, 14, 15]])
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   130
\end{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   131
How will you get the following \lstinline+x+?
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   132
\begin{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   133
  array([[ 5, 7],
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   134
         [ 9, 11]])
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   135
\end{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   136
\end{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   137
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   138
\begin{frame}[fragile]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   139
\frametitle{\incqno }
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   140
\begin{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   141
  >>> x = array(([1,2,3,4],[2,3,4,5]))
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   142
  >>> x[-2][-3] = 4
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   143
  >>> x
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   144
\end{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   145
What will be printed?
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   146
\end{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   147
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   148
\begin{frame}[fragile]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   149
\frametitle{\incqno }
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   150
What would be the output?
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   151
\begin{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   152
  >>> y = arange(4)
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   153
  >>> x = array(([1,2,3,2],[1,3,6,0]))
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   154
  >>> x + y
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   155
\end{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   156
\end{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   157
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   158
\begin{frame}[fragile]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   159
\frametitle{\incqno }
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   160
\begin{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   161
  >>> line = plot(x, sin(x))
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   162
\end{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   163
Use the \lstinline+set_linewidth+ method to set width of \lstinline+line+ to 2.
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   164
\end{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   165
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   166
\begin{frame}[fragile]
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   167
\frametitle{\incqno }
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   168
What would be the output?
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   169
\begin{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   170
  >>> x = arange(9)
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   171
  >>> y = arange(9.)
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   172
  >>> x == y
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   173
\end{lstlisting}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   174
\end{frame}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   175
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   176
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   177
\end{document}
896f96b9de3b Added Day2 Quiz.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
   178