day2/session1.tex
author Madhusudan.C.S <madhusudancs@gmail.com>
Fri, 06 Nov 2009 18:33:08 +0530
changeset 288 c4e25269a86c
parent 250 760d5679834e
child 297 a835affb1447
permissions -rw-r--r--
Reorganized slides.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     2
%Tutorial slides on Python.
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     3
%
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
     4
% Author: FOSSEE 
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
     5
% Copyright (c) 2009, FOSSEE, IIT Bombay
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     6
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     7
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     8
\documentclass[14pt,compress]{beamer}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
     9
%\documentclass[draft]{beamer}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    10
%\documentclass[compress,handout]{beamer}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    11
%\usepackage{pgfpages} 
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    12
%\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    13
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    14
% Modified from: generic-ornate-15min-45min.de.tex
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    15
\mode<presentation>
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    16
{
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    17
  \usetheme{Warsaw}
239
8953675dc056 Added slide numbers.
Puneeth Chaganti <punchagan@fossee.in>
parents: 227
diff changeset
    18
  \useoutertheme{infolines}
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    19
  \setbeamercovered{transparent}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    20
}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    21
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    22
\usepackage[english]{babel}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    23
\usepackage[latin1]{inputenc}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    24
%\usepackage{times}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    25
\usepackage[T1]{fontenc}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    26
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    27
% Taken from Fernando's slides.
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    28
\usepackage{ae,aecompl}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    29
\usepackage{mathpazo,courier,euler}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    30
\usepackage[scaled=.95]{helvet}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    31
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    32
\definecolor{darkgreen}{rgb}{0,0.5,0}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    33
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    34
\usepackage{listings}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    35
\lstset{language=Python,
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    36
    basicstyle=\ttfamily\bfseries,
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    37
    commentstyle=\color{red}\itshape,
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    38
  stringstyle=\color{darkgreen},
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    39
  showstringspaces=false,
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    40
  keywordstyle=\color{blue}\bfseries}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    41
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    42
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    43
% Macros
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    44
\setbeamercolor{emphbar}{bg=blue!20, fg=black}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    45
\newcommand{\emphbar}[1]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    46
{\begin{beamercolorbox}[rounded=true]{emphbar} 
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    47
      {#1}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    48
 \end{beamercolorbox}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    49
}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    50
\newcounter{time}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    51
\setcounter{time}{0}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    52
\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    53
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    54
\newcommand{\typ}[1]{\texttt{#1}}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    55
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    56
\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}}  }
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    57
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    58
%%% This is from Fernando's setup.
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    59
% \usepackage{color}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    60
% \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    61
% % Use and configure listings package for nicely formatted code
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    62
% \usepackage{listings}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    63
% \lstset{
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    64
%    language=Python,
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    65
%    basicstyle=\small\ttfamily,
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    66
%    commentstyle=\ttfamily\color{blue},
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    67
%    stringstyle=\ttfamily\color{orange},
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    68
%    showstringspaces=false,
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    69
%    breaklines=true,
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    70
%    postbreak = \space\dots
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    71
% }
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    72
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    73
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    74
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    75
% Title page
250
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
    76
\title[Basic Python]{Python language: Basics}
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    77
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    78
\author[FOSSEE Team] {The FOSSEE Group}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    79
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    80
\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
    81
\date[] {8 November, 2009\\Day 2, Session 1}
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    82
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    83
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    84
%\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    85
%\logo{\pgfuseimage{iitmlogo}}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    86
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    87
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    88
%% Delete this, if you do not want the table of contents to pop up at
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    89
%% the beginning of each subsection:
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    90
\AtBeginSubsection[]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    91
{
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    92
  \begin{frame}<beamer>
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    93
    \frametitle{Outline}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    94
    \tableofcontents[currentsection,currentsubsection]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    95
  \end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    96
}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    97
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    98
\AtBeginSection[]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
    99
{
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   100
  \begin{frame}<beamer>
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   101
    \frametitle{Outline}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   102
    \tableofcontents[currentsection,currentsubsection]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   103
  \end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   104
}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   105
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   106
% If you wish to uncover everything in a step-wise fashion, uncomment
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   107
% the following command: 
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   108
%\beamerdefaultoverlayspecification{<+->}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   109
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   110
%\includeonlyframes{current,current1,current2,current3,current4,current5,current6}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   111
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   112
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   113
% DOCUMENT STARTS
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   114
\begin{document}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   115
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   116
\begin{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   117
  \titlepage
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   118
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   119
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   120
\begin{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   121
  \frametitle{Outline}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   122
  \tableofcontents
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   123
  % You might wish to add the option [pausesections]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   124
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   125
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   126
\section{Data types}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   127
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   128
\begin{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   129
  \frametitle{Primitive Data types}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   130
  \begin{itemize}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   131
    \item Numbers: float, int, complex
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   132
    \item Strings
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   133
    \item Boolean
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   134
  \end{itemize}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   135
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   136
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   137
\subsection{Numbers}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   138
\begin{frame}[fragile]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   139
  \frametitle{Numbers}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   140
  \begin{itemize}
250
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   141
    \item \kwrd{int}\\ \kwrd{int} = whole number, no matter what the size!
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   142
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   143
In []: a = 13
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   144
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   145
In []: b = 99999999999999999999
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   146
  \end{lstlisting}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   147
    \item \kwrd{float}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   148
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   149
In []: p = 3.141592
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   150
  \end{lstlisting}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   151
  \end{itemize}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   152
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   153
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   154
\begin{frame}[fragile]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   155
\frametitle{Complex numbers}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   156
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   157
In []: c = 3+4j
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   158
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   159
In []: abs(c)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   160
Out[]: 5.0
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   161
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   162
In []: c.imag
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   163
Out[]: 4.0
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   164
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   165
In []: c.real
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   166
Out[]: 3.0
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   167
  \end{lstlisting}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   168
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   169
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   170
\subsection{Boolean}
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   171
\begin{frame}[fragile]
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   172
  \frametitle{Boolean}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   173
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   174
In []: t = True
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   175
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   176
In []: f = not t
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   177
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   178
In []: f or t
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   179
Out[]: True
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   180
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   181
In []: f and t
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   182
Out[]: False
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   183
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   184
  \inctime{5}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   185
\end{frame}
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   186
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   187
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   188
  \frametitle{( )  for precedence}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   189
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   190
In []: a = False
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   191
In []: b = True
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   192
In []: c = True
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   193
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   194
In []: (a and b) or c
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   195
Out[]: True
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   196
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   197
In []: a and (b or c)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   198
Out[]: False
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   199
  \end{lstlisting}
227
a6705e2dfdc6 Complete session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 217
diff changeset
   200
  \inctime{5}
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   201
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   202
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   203
\subsection{Strings}
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   204
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   205
\begin{frame}[fragile]
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   206
  \frametitle{Strings}
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   207
Strings were introduced previously, let us now look at them in a little more detail.
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   208
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   209
In []: w = "hello"
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   210
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   211
In []: print w[0] + w[2] + w[-1]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   212
Out[]: hlo
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   213
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   214
In []: len(w) # guess what
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   215
Out[]: 5
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   216
  \end{lstlisting}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   217
\end{frame}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   218
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   219
\begin{frame}[fragile]
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   220
  \frametitle{Strings \ldots}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   221
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   222
In []: w[0] = 'H' # Can't do that!
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   223
--------------------------------------------
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   224
TypeError  Traceback (most recent call last)
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   225
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   226
/<ipython console> in <module>()
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   227
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   228
TypeError: 'str' object does not
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   229
         support item assignment
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   230
  \end{lstlisting}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   231
\end{frame}
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   232
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   233
\begin{frame}[fragile]
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   234
  \frametitle{String methods}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   235
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   236
In []: a = 'Hello World'
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   237
In []: a.startswith('Hell')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   238
Out[]: True
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   239
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   240
In []: a.endswith('ld')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   241
Out[]: True
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   242
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   243
In []: a.upper()
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   244
Out[]: 'HELLO WORLD'
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   245
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   246
In []: a.lower()
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   247
Out[]: 'hello world'
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   248
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   249
\end{frame}
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   250
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   251
\begin{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   252
  \frametitle{A bit about IPython}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   253
  \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   254
    \item IPython provides better help
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   255
    \item object.function?
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   256
    \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   257
In []: a = 'Hello World'
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   258
In []: a.lower?
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   259
    \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   260
    \item It provides tab completion
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   261
        \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   262
In []: a.s<Tab>
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   263
    \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   264
  \end{itemize}
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   265
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   266
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   267
\begin{frame}[fragile]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   268
\frametitle{Still with strings}
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   269
  \begin{itemize}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   270
    \item We saw split() yesterday
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   271
    \item join() is the opposite of split()
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   272
  \end{itemize}
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   273
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   274
In []: ''.join(['a', 'b', 'c'])
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   275
Out[]: 'abc'
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   276
  \end{lstlisting}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   277
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   278
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   279
\begin{frame}[fragile]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   280
\frametitle{String formatting}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   281
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   282
In []: x, y = 1, 1.234
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   283
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   284
In []: 'x is %s, y is %s' %(x, y)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   285
Out[]: 'x is 1, y is 1.234'
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   286
  \end{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   287
  \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   288
    \item \emph{\%d}, \emph{\%f} etc. available
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   289
  \end{itemize}
227
a6705e2dfdc6 Complete session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 217
diff changeset
   290
  \emphbar{\url{http://docs.python.org/library/stdtypes.html}}
a6705e2dfdc6 Complete session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 217
diff changeset
   291
  \inctime{10}
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   292
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   293
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   294
\section{Operators}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   295
\begin{frame}[fragile]
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   296
  \frametitle{Arithmetic operators}
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   297
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   298
In []: 1786 % 12
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   299
Out[]: 10
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   300
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   301
In []: 45 % 2
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   302
Out[]: 1
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   303
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   304
In []: 864675 % 10
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   305
Out[]: 5
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   306
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   307
In []: 3124 * 126789
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   308
Out[]: 396088836
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   309
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   310
In []: big = 1234567891234567890 ** 3
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   311
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   312
In []: verybig = big * big * big * big
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   313
  \end{lstlisting}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   314
\end{frame}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   315
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   316
\begin{frame}[fragile]
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   317
  \frametitle{Arithmetic operators}
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   318
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   319
In []: 17 / 2
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   320
Out[]: 8
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   321
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   322
In []: 17 / 2.0
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   323
Out[]: 8.5
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   324
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   325
In []: 17.0 / 2
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   326
Out[]: 8.5
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   327
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   328
In []: 17.0 / 8.5
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   329
Out[]: 2.0
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   330
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   331
\end{frame}
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   332
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   333
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   334
  \frametitle{Arithmetic operators}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   335
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   336
In []: a = 7546
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   337
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   338
In []: a += 1
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   339
In []: a
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   340
Out[]: 7547
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   341
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   342
In []: a -= 5
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   343
In []: a
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   344
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   345
In []: a *= 2
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   346
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   347
In []: a /= 5
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   348
  \end{lstlisting}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   349
\end{frame}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   350
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   351
\begin{frame}[fragile]
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   352
  \frametitle{String operations}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   353
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   354
In []: s = 'Hello '
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   355
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   356
In []: p = 'World'
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   357
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   358
In []: s + p 
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   359
Out[]: 'Hello World'
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   360
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   361
In []: s * 4
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   362
Out[]: 'Hello Hello Hello Hello'
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   363
  \end{lstlisting}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   364
\end{frame}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   365
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   366
\begin{frame}[fragile]
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   367
  \frametitle{String operations \ldots}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   368
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   369
In []: s * s
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   370
--------------------------------------------
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   371
TypeError  Traceback (most recent call last)
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   372
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   373
/<ipython console> in <module>()
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   374
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   375
TypeError: can't multiply sequence by
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   376
                non-int of type 'str'
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   377
  \end{lstlisting}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   378
\end{frame}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   379
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   380
\begin{frame}[fragile]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   381
  \frametitle{Relational and logical operators}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   382
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   383
In []: p, z, n = 1, 0, -1
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   384
In []: p == n
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   385
Out[]: False
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   386
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   387
In []: p >= n
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   388
Out[]: True
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   389
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   390
In []: n < z < p
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   391
Out[]: True
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   392
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   393
In []: p + n != z
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   394
Out[]: False
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   395
  \end{lstlisting}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   396
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   397
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   398
\begin{frame}[fragile]
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   399
  \frametitle{Built-ins}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   400
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   401
In []: int(17 / 2.0)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   402
Out[]: 8
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   403
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   404
In []: float(17 / 2)  # Recall
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   405
Out[]: 8.0
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   406
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   407
In []: str(17 / 2.0)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   408
Out[]: '8.5'
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   409
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   410
In []: round( 7.5 )
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   411
Out[]: 8.0
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   412
  \end{lstlisting}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   413
\end{frame}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   414
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   415
\begin{frame}[fragile]
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   416
  \frametitle{Odds and ends}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   417
  \begin{itemize}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   418
    \item Case sensitive
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   419
    \item Dynamically typed $\Rightarrow$ need not specify a type
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   420
      \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   421
In []: a = 1
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   422
In []: a = 1.1
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   423
In []: a = "Now I am a string!"
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   424
      \end{lstlisting}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   425
    \item Comments:
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   426
      \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   427
In []: a = 1  # In-line comments
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   428
In []: # A comment line.
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   429
In []: a = "# Not a comment!"
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   430
      \end{lstlisting}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   431
  \end{itemize}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   432
  \inctime{15}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   433
\end{frame}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   434
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   435
\section{Simple IO}
250
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   436
\begin{frame}[fragile]
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   437
  \frametitle{Simple IO: Console Input}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   438
  \small
250
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   439
  \begin{itemize}
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   440
    \item raw\_input() waits for user input.
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   441
      \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   442
In []: a = raw_input()
250
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   443
5
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   444
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   445
In []: a = raw_input('Enter a value: ')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   446
Enter a value: 5
250
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   447
      \end{lstlisting}
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   448
    \item Prompt string is optional.
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   449
    \item All keystrokes are Strings!
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   450
    \item \texttt{int()} converts string to int.
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   451
  \end{itemize}
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   452
\end{frame}
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   453
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   454
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   455
  \frametitle{Simple IO: Console output}
250
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   456
  \begin{itemize}
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   457
    \item \texttt{print} is straight forward
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   458
    \item Put the following code snippet in a file
250
760d5679834e Fixed typos and hanging words in Session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 239
diff changeset
   459
  \end{itemize}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   460
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   461
print "Hello"
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   462
print "World"
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   463
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   464
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   465
In []: %run -i hello1.py
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   466
Hello
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   467
World
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   468
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   469
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   470
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   471
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   472
  \frametitle{Simple IO: Console output \ldots}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   473
Put the following code snippet in a file
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   474
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   475
print "Hello",
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   476
print "World"
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   477
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   478
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   479
In []: %run -i hello2.py
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   480
Hello World
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   481
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   482
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   483
\emphbar{Note the distinction between \texttt{print x} and \texttt{print x,}}
216
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   484
\end{frame}
c6704d4a18bd Removed multiplication of list with * operator.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 204
diff changeset
   485
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   486
\section{Control flow}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   487
\begin{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   488
  \frametitle{Control flow constructs}  
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   489
  \begin{itemize}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   490
  \item \kwrd{if/elif/else}: branching
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   491
  \item \kwrd{C if X else Y}: Ternary conditional operator
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   492
  \item \kwrd{while}: looping
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   493
  \item \kwrd{for}: iterating
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   494
  \item \kwrd{break, continue}: modify loop 
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   495
  \item \kwrd{pass}: syntactic filler
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   496
  \end{itemize}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   497
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   498
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   499
\subsection{Basic Conditional flow}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   500
\begin{frame}[fragile]
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   501
  \frametitle{\typ{If...elif...else} example}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   502
  \small
227
a6705e2dfdc6 Complete session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 217
diff changeset
   503
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   504
In []: x = int(raw_input("Enter an integer:"))
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   505
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   506
In []: if x < 0:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   507
  ...:     print 'Be positive!'
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   508
  ...: elif x == 0:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   509
  ...:     print 'Zero'
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   510
  ...: elif x == 1:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   511
  ...:     print 'Single'
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   512
  ...: else:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   513
  ...:     print 'More'
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   514
  ...:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   515
  ...:
227
a6705e2dfdc6 Complete session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 217
diff changeset
   516
  \end{lstlisting}
a6705e2dfdc6 Complete session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 217
diff changeset
   517
  \inctime{10}
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   518
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   519
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   520
\begin{frame}[fragile]
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   521
  \frametitle{Ternary conditional operator}
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   522
  \begin{lstlisting}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   523
...
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   524
a = raw_input('Enter number(Q to quit):')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   525
num = int(a) if a != 'Q' else break
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   526
...
217
2833f0b51adc Completed day 2 Session 1.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 216
diff changeset
   527
  \end{lstlisting}
227
a6705e2dfdc6 Complete session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 217
diff changeset
   528
\end{frame}
a6705e2dfdc6 Complete session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 217
diff changeset
   529
a6705e2dfdc6 Complete session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 217
diff changeset
   530
\begin{frame}[fragile]
a6705e2dfdc6 Complete session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 217
diff changeset
   531
  \frametitle{What did we learn?}
a6705e2dfdc6 Complete session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 217
diff changeset
   532
  \begin{itemize}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   533
    \item Data types: int, float, complex, boolean, string
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   534
    \item Operators: +, -, *, /, \%, **, +=, -=, *=, /=, >, <, <=, >=, ==, !=, a < b < c
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   535
    \item Simple IO: \kwrd{raw\_input} and \kwrd{print}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 250
diff changeset
   536
    \item Conditional structures: \kwrd{if/elif/else},\\ \kwrd{C if X else Y}
227
a6705e2dfdc6 Complete session 1 day 2.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 217
diff changeset
   537
  \end{itemize}
135
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   538
\end{frame}
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   539
a5da7607ab14 Added Session 1, Day 2 - "Formal approach to Python" slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff changeset
   540
\end{document}