257 \end{frame} |
257 \end{frame} |
258 |
258 |
259 \begin{frame}[fragile] |
259 \begin{frame}[fragile] |
260 \frametitle{List methods} |
260 \frametitle{List methods} |
261 \begin{lstlisting} |
261 \begin{lstlisting} |
262 In []: lst.append([6,7]) |
262 In []: lst.append(6) |
263 In []: lst |
263 In []: lst |
264 Out[]: [1, 2, 3, 4, 5, [6, 7]] |
264 Out[]: [1, 2, 3, 4, 5, 6] |
265 \end{lstlisting} |
265 \end{lstlisting} |
266 %\inctime{10} |
266 %\inctime{10} |
267 \end{frame} |
267 \end{frame} |
268 |
268 |
269 \begin{frame}[fragile] |
269 \begin{frame}[fragile] |
270 \frametitle{\typ{for}} |
270 \frametitle{\texttt{for}} |
271 Used to iterate over lists\\ Let us look at another example. |
271 Used to iterate over lists\\ Let us look at another example. |
272 \begin{lstlisting} |
272 \begin{lstlisting} |
273 In []: lst = [1,2,3,4,5,6] |
273 In []: lst = [1,2,3,4,5,6] |
274 In []: for num in lst: |
274 In []: for num in lst: |
275 ....: print num, num*num |
275 ....: print num, num*num |