day2/session2.tex
changeset 380 669b72283b55
parent 378 2299700a8b97
child 384 9f9fddf7e37c
--- a/day2/session2.tex	Mon Mar 08 20:45:33 2010 +0530
+++ b/day2/session2.tex	Thu Mar 11 18:01:23 2010 +0530
@@ -153,9 +153,7 @@
 \begin{block}{Documentation convention}
   \begin{itemize}
     \item \alert{Anything within \typ{[]} is optional}
-    \begin{itemize}
-      \item Nothing to do with Python.
-    \end{itemize}
+    \item Nothing to do with Python.
   \end{itemize}
 \end{block}
 \end{frame}
@@ -219,37 +217,37 @@
   \begin{lstlisting}
 num = [1, 2, 3, 4]
   \end{lstlisting}
-\centerline{is a list}
+is a list
 \end{block}
 \end{frame}
 
 \begin{frame}[fragile]
   \frametitle{Lists: methods}
   \begin{lstlisting}
-In []: num = [1, 2, 3, 4]
+In []: num = [9, 8, 2, 3, 7]
 
-In []: num + [9, 10, 11]
-Out[]: [1, 2, 3, 4, 9, 10, 11]
+In []: num + [4, 5, 6]
+Out[]: [9, 8, 2, 3, 7, 4, 5, 6]
 
-In []: num.append([9, 10, 11])
+In []: num.append([4, 5, 6])
 
 In []: num
-Out[]: [1, 2, 3, 4, [9, 10, 11]]
+Out[]: [9, 8, 2, 3, 7, [4, 5, 6]]
   \end{lstlisting}
 \end{frame}
 
 \begin{frame}[fragile]
   \frametitle{Lists: methods}
   \begin{lstlisting}
-In []: num = [1, 2, 3, 4]
+In []: num = [9, 8, 2, 3, 7]
 
-In []: num.extend([5, 6, 7])
+In []: num.extend([4, 5, 6])
 In []: num
-Out[]: [1, 2, 3, 4, 5, 6, 7]
+Out[]: [9, 8, 2, 3, 7, 4, 5, 6]
 
 In []: num.reverse()
 In []: num
-Out[]: [7, 6, 5, 4, 3, 2, 1]
+Out[]: [6, 5, 4, 7, 3, 2, 8, 9]
 
 In []: num.remove(6)
 In []: num
@@ -294,17 +292,17 @@
 
 \begin{frame}[fragile]
 \frametitle{List containership}
-\emphbar{Recall \typ{num} is \typ{[1, 2, 3, 4]}}
+\emphbar{Recall \typ{num} is \typ{[9, 8, 2, 3, 7]}}
 \begin{lstlisting}
 In []: 4 in num
+Out[]: False
+
+In []: b = 8
+In []: b in num
 Out[]: True
 
-In []: b = 15
-In []: b in num
+In []: b not in num
 Out[]: False
-
-In []: b not in num
-Out[]: True
 \end{lstlisting}
 \end{frame}
 
@@ -387,7 +385,7 @@
 \end{frame}
 
 \begin{frame} {Problem Set 2.1: Problem 2.1.1}
-You are given date strings of the form ``29 Jul, 2009'', or ``4 January 2008''. In other words a number, a string and another number, with a comma sometimes separating the items.\\Write a function that takes such a string and returns a tuple (yyyy, mm, dd) where all three elements are ints.
+You are given date strings of the form ``29 Jul, 2009'', or ``4 January 2008''. In other words a number, a string and another number, with a comma sometimes separating the items.\\Write a program that takes such a string as input and prints a tuple (yyyy, mm, dd) where all three elements are ints.
 \end{frame}
 
 \subsection{Sets}
@@ -453,7 +451,6 @@
   \frametitle{Problem 2.2.2}
 Given a list of words, find all the anagrams in the list.
 
-\inctime{15}
 \end{frame}
 
 \section{Functions}