# HG changeset patch # User Madhusudan.C.S # Date 1256725387 -19800 # Node ID a6705e2dfdc68857f3b22226c38d17f5e35af5a2 # Parent 0aa2964438c6d05a3c02fd75246db65522d81c77 Complete session 1 day 2. diff -r 0aa2964438c6 -r a6705e2dfdc6 day2/session1.tex --- a/day2/session1.tex Wed Oct 28 13:06:58 2009 +0530 +++ b/day2/session1.tex Wed Oct 28 15:53:07 2009 +0530 @@ -182,6 +182,7 @@ In [4]: f and t Out[4]: False \end{lstlisting} + \inctime{5} \end{frame} \subsection{Strings} @@ -252,10 +253,8 @@ In [2]: 'x is %s, y is %s' %(x, y) Out[2]: 'x is 1, y is 1.234' \end{lstlisting} -\emphbar{ -\url{http://docs.python.org/library/stdtypes.html}\\ -} -\inctime{10} + \emphbar{\url{http://docs.python.org/library/stdtypes.html}} + \inctime{10} \end{frame} \section{Operators} @@ -338,7 +337,6 @@ In [5]: pos + neg != zer Out[5]: False \end{lstlisting} -\inctime{5} \end{frame} \begin{frame}[fragile] @@ -378,19 +376,6 @@ \inctime{15} \end{frame} -\begin{frame}[fragile] \frametitle{A question of good style} - \begin{lstlisting} - amount = 12.68 - denom = 0.05 - nCoins = round(amount/denom) - rAmount = nCoins * denom - \end{lstlisting} - \pause - \begin{block}{Style Rule \#1} - Naming is 80\% of programming - \end{block} -\end{frame} - \section{Simple IO} \begin{frame}{Simple IO} \begin{block} @@ -419,7 +404,7 @@ \subsection{Basic Conditional flow} \begin{frame}[fragile] \frametitle{\typ{If...elif...else} example} -\begin{lstlisting} + \begin{lstlisting} x = int(raw_input("Enter an integer:")) if x < 0: print 'Be positive!' @@ -429,7 +414,8 @@ print 'Single' else: print 'More' -\end{lstlisting} + \end{lstlisting} + \inctime{10} \end{frame} \subsection{Basic Looping} @@ -470,7 +456,7 @@ 3 9 4 16 \end{lstlisting} -\inctime{15} +\inctime{5} \end{frame} \subsection{Exercises} @@ -496,10 +482,9 @@ \item It appears that for all starting values there is a cycle of 4, 2, 1 at which the procedure loops. \end{enumerate} Write a program that accepts the starting value and prints out the Collatz sequence. - \end{frame} -\begin{frame}[fragile]{Problem 1.4} +\begin{frame}[fragile]{Problem 1.3} Write a program that prints the following pyramid on the screen. \begin{lstlisting} 1 @@ -510,7 +495,17 @@ The number of lines must be obtained from the user as input.\\ \pause \emphbar{When can your code fail?} -\only<2->{\inctime{20}} +\only<2->{\inctime{10}} +\end{frame} + +\begin{frame}[fragile] + \frametitle{What did we learn?} + \begin{itemize} + \item Basic data types + \item Arithematic, logical and relational operations + \item Conditional structures + \item Loops + \end{itemize} \end{frame} \end{document}