day1quiz1.tex
changeset 332 f2ca851199d4
parent 263 8a4a1e5aec85
child 334 2214b5dba4d4
equal deleted inserted replaced
302:8ea4739a7f1f 332:f2ca851199d4
    38 \title[Basic Python]{Python: Quiz}
    38 \title[Basic Python]{Python: Quiz}
    39 
    39 
    40 \author[FOSSEE Team] {FOSSEE}
    40 \author[FOSSEE Team] {FOSSEE}
    41 
    41 
    42 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
    42 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
    43 \date[] {31, October 2009\\Day 1, Quiz 1}
    43 \date[] {14, December 2009\\Day 1, Quiz 1}
    44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    45 
    45 
    46 
    46 
    47 \begin{document}
    47 \begin{document}
    48 
    48 
   113     2 c
   113     2 c
   114     3 d
   114     3 d
   115   \end{lstlisting}
   115   \end{lstlisting}
   116 \end{frame}
   116 \end{frame}
   117 
   117 
   118 \begin{frame}[fragile]
   118 \begin{frame}
   119 \frametitle{\incqno }
   119 \frametitle{\incqno }
   120 What would be the result?
   120 What ipython magic command do you use to obtain the lines of code you have already typed in the interpreter? What command do you use to save them?
   121 \begin{lstlisting}
       
   122   In [1]: x
       
   123          array([[0, 1, 2],
       
   124                 [3, 4, 5],
       
   125                 [6, 7, 8]])
       
   126   In [2]: x[::-1,:]
       
   127 \end{lstlisting}
       
   128 \end{frame}
   121 \end{frame}
   129 
   122 
   130 \begin{frame}
   123 \begin{frame}
   131 \frametitle{\incqno }
   124 \frametitle{\incqno }
   132 How to read and print each line of a file.
   125 How to read and print each line of a file?
   133 \end{frame}
       
   134 
       
   135 \begin{frame}
       
   136 \frametitle{\incqno }
       
   137 How to get list of third column of a data file.
       
   138 \end{frame}
   126 \end{frame}
   139 
   127 
   140 \begin{frame}[fragile]
   128 \begin{frame}[fragile]
   141 \frametitle{\incqno }
   129 \frametitle{\incqno }
   142 What is the output of:
   130 What is the output of:
   154 \begin{frame}
   142 \begin{frame}
   155 \frametitle{\incqno }
   143 \frametitle{\incqno }
   156 Setting x and y axis limits.
   144 Setting x and y axis limits.
   157 \end{frame}
   145 \end{frame}
   158 
   146 
       
   147 \begin{frame}[fragile]
       
   148 \frametitle{\incqno }
       
   149 The following code snippet has an error/bug:
       
   150 \begin{lstlisting}
       
   151 In []: l = [0.1, 0.2, 0.3, 0.4]
       
   152 In []: t = [0.69, 0.90, 1.19, 1.30]
       
   153 In []: tsq = []
       
   154 In []: for time in t:
       
   155  ....:     tsq.append(time*time)
       
   156  ....:     plot(l, tsq)
       
   157 \end{lstlisting}
       
   158 
       
   159 What is the error? How do you fix it?
       
   160 \end{frame}
       
   161 
   159 \end{document}
   162 \end{document}
   160