day1quiz2.tex
author Santosh G. Vattam <vattam.santosh@gmail.com>
Wed, 18 Nov 2009 17:07:19 +0530
changeset 309 0b1f2c378d84
parent 306 57291186d598
child 343 adb85e126341
permissions -rw-r--r--
Minor changes on cheatsheet of session 2 day 1.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     2
% Tutorial slides on Python.
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     3
%
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     4
% Author: FOSSEE <info at fossee  dot in>
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     5
% Copyright (c) 2005-2009, FOSSEE Team
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     6
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     7
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     8
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     9
\documentclass[14pt,compress]{beamer}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    10
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    11
\mode<presentation>
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    12
{
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    13
  \useoutertheme{split}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    14
  \setbeamercovered{transparent}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    15
}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    16
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    17
\definecolor{darkgreen}{rgb}{0,0.5,0}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    18
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    19
\usepackage{listings}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    20
\lstset{language=Python,
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    21
    basicstyle=\ttfamily\bfseries,
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    22
    commentstyle=\color{red}\itshape,
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    23
  stringstyle=\color{darkgreen},
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    24
  showstringspaces=false,
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    25
  keywordstyle=\color{blue}\bfseries}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    26
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    27
\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}}  }
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    28
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    29
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    30
% Macros
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    31
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    32
\newcounter{qno}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    33
\setcounter{qno}{0}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    34
\newcommand{\incqno}{\addtocounter{qno}{1}{Question \theqno}}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    35
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    36
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    37
% Title page
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    38
\title[Basic Python]{Python for science and engineering: Day 1, Quiz 2}
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    39
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    40
\author[FOSSEE Team] {FOSSEE}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    41
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    42
\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    43
\date[] {\today \\
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    44
Day 1, quiz 2}
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    45
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    46
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    47
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    48
\begin{document}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    49
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    50
\begin{frame}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    51
  \titlepage
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    52
\end{frame}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    53
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    54
\begin{frame}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    55
  \frametitle{Write your details...}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    56
On the top right hand corner please write down the following:
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    57
  \begin{itemize}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    58
    \item Name:
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    59
    \item University/College/Company:
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    60
    \item Student/Teacher/Professional:
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    61
  \end{itemize}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    62
\end{frame}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    63
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    64
%% \begin{frame}[fragile]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    65
%% \frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    66
%% \begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    67
%%   In []: x = array([[1,2,3,4],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    68
%%                     [3,4,2,5]])
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    69
%% \end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    70
%% What is the \lstinline+shape+ of this array?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    71
%% \end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    72
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    73
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    74
\begin{frame}[fragile]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    75
\frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    76
\begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    77
  In []: x = array([[1,2,3,4]])
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    78
\end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    79
How to change the third element (i.e.\ 3) of \lstinline+x+ to 0?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    80
\end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    81
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    82
\begin{frame}[fragile]
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    83
\frametitle{\incqno }
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    84
\begin{lstlisting}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    85
  In []: x = array([[1,2,3,4],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    86
                    [3,4,2,5]])
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    87
\end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    88
How do you get the following slice of \lstinline+x+?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    89
\begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    90
array([[2,3],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    91
       [4,2]])
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    92
\end{lstlisting}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    93
\end{frame}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    94
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    95
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    96
%% \begin{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    97
%% \frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    98
%% The file \lstinline+datafile.txt+ contains 3 columns of data.  What
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
    99
%% command will you use to read the entire data file into an array?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   100
%% \end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   101
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   102
%% \begin{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   103
%% \frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   104
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   105
%% If the contents of the file \lstinline+datafile.txt+ is read into an
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   106
%% $N\times3$ array called \lstinline+data+, how would you obtain the third
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   107
%% column of this data?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   108
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   109
%% \end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   110
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   111
\begin{frame}[fragile]
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   112
\frametitle{\incqno }
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   113
\begin{lstlisting}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   114
  In []: x = array(([1,2,3,4],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   115
                    [2,3,4,5]))
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   116
  In []: x[-2][-3] = 4
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   117
  In []: print x
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   118
\end{lstlisting}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   119
What will be printed?
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   120
\end{frame}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   121
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   122
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   123
%% \begin{frame}[fragile]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   124
%% \frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   125
%% \begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   126
%%   In []: x = arange(0, 1, 0.25)
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   127
%%   In []: print x
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   128
%% \end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   129
%% What will be printed?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   130
%% \end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   131
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   132
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   133
%% \begin{frame}[fragile]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   134
%% \frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   135
%% \begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   136
%% from scipy.integrate import quad
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   137
%% def f(x):
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   138
%%     res = x*cos(x)
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   139
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   140
%% quad(f, 0, 1)
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   141
%% \end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   142
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   143
%% What changes will you make to the above code to make it work?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   144
%% \end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   145
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   146
%% \begin{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   147
%% \frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   148
%% What two commands will you use to create and evaluate a spline given
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   149
%% some data?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   150
%% \end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   151
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   152
\begin{frame}
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   153
\frametitle{\incqno }
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   154
What command will you use if you wish to integrate a system of ODEs?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   155
\end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   156
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   157
\begin{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   158
\frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   159
How do you calculate the roots of the polynomial, $y = 1 + 6x + 8x^2 +
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   160
x^3$?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   161
\end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   162
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   163
\begin{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   164
\frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   165
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   166
Two arrays \lstinline+a+ and \lstinline+b+ are numerically almost equal, what command
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   167
do you use to check if this is true?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   168
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   169
\end{frame}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   170
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   171
\begin{frame}[fragile]
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   172
\frametitle{\incqno }
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   173
\begin{lstlisting}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   174
In []: marks = [10, 20, 30, 50, 55, 
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   175
               75, 83] 
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   176
\end{lstlisting}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   177
How will you convert the list \texttt{marks} to an \alert{array}?
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   178
\end{frame}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   179
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   180
\begin{frame}[fragile]
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   181
\frametitle{\incqno }
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   182
\begin{lstlisting}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   183
In []: a = array([[1, 2],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   184
                  [3, 4]])
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   185
In []: a[1,0] = 0
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   186
\end{lstlisting}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   187
What is the resulting matrix?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   188
\end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   189
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   190
\begin{frame}[fragile]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   191
\frametitle{\incqno }
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   192
\begin{lstlisting}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   193
In []: a = array([[1, 2],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   194
                  [3, 4]])
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   195
\end{lstlisting}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   196
How do you get the transpose of this array?
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   197
\end{frame}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   198
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   199
\begin{frame}[fragile]
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   200
\frametitle{\incqno }
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   201
\begin{lstlisting}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   202
In []: a = array([[1, 2],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   203
                  [3, 4]])
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   204
In []: b = array([[1, 1],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   205
                  [2, 2]])
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   206
In []: a*b
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   207
\end{lstlisting}
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   208
What does this produce?
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   209
\end{frame}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   210
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   211
\begin{frame}
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   212
\frametitle{\incqno }
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   213
What command do you use to find the inverse of a matrix and its
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   214
eigenvalues?
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   215
\end{frame}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   216
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   217
\begin{frame}
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   218
\frametitle{\incqno }
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   219
Given a 4x4 matrix \texttt{A} and a 4-vector \texttt{b}, what command do
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   220
you use to solve for the equation \\
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   221
\texttt{Ax = b}?
261
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   222
\end{frame}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   223
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   224
\end{document}
9cce24d00957 1 quiz, seesion5 plots, added links to reference.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   225
306
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   226
%% \begin{frame}[fragile]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   227
%% \frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   228
%% What would be the result?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   229
%% \begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   230
%%   In []: x
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   231
%%   array([[0, 1, 2],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   232
%%          [3, 4, 5],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   233
%%          [6, 7, 8]])
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   234
%%   In []: x[::-1,:]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   235
%% \end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   236
%% Hint:
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   237
%% \begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   238
%%   In []: x = arange(9)
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   239
%%   In []: x[::-1]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   240
%%   array([8, 7, 6, 5, 4, 3, 2, 1, 0])
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   241
%% \end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   242
%% \end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   243
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   244
%% \begin{frame}[fragile]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   245
%% \frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   246
%% What would be the result?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   247
%% \begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   248
%%   In []: y = arange(3)
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   249
%%   In []: x = linspace(0,3,3)
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   250
%%   In []: x-y
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   251
%% \end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   252
%% \end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   253
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   254
%% \begin{frame}[fragile]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   255
%% \frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   256
%% \begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   257
%%   In []: x
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   258
%%   array([[ 0, 1, 2, 3],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   259
%%          [ 4, 5, 6, 7],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   260
%%          [ 8, 9, 10, 11],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   261
%%          [12, 13, 14, 15]])
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   262
%% \end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   263
%% How will you get the following \lstinline+x+?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   264
%% \begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   265
%%   array([[ 5, 7],
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   266
%%          [ 9, 11]])
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   267
%% \end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   268
%% \end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   269
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   270
%% \begin{frame}[fragile]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   271
%% \frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   272
%% What would be the output?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   273
%% \begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   274
%%   In []: y = arange(4)
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   275
%%   In []: x = array(([1,2,3,2],[1,3,6,0]))
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   276
%%   In []: x + y
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   277
%% \end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   278
%% \end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   279
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   280
%% \begin{frame}[fragile]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   281
%% \frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   282
%% \begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   283
%%   In []: line = plot(x, sin(x))
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   284
%% \end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   285
%% Use the \lstinline+set_linewidth+ method to set width of \lstinline+line+ to 2.
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   286
%% \end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   287
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   288
%% \begin{frame}[fragile]
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   289
%% \frametitle{\incqno }
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   290
%% What would be the output?
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   291
%% \begin{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   292
%%   In []: x = arange(9)
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   293
%%   In []: y = arange(9.)
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   294
%%   In []: x == y
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   295
%% \end{lstlisting}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   296
%% \end{frame}
57291186d598 Updated the quiz tex files of both day 1 and day 2.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents: 261
diff changeset
   297