input_output/slides.tex
author Anoop Jacob Thomas<anoop@fossee.in>
Wed, 13 Oct 2010 14:00:33 +0530
changeset 319 e8c02b3c51ac
parent 276 89437325b326
permissions -rw-r--r--
changed headers of scripts(objectives and prerequisites).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
     1
% Created 2010-10-10 Sun 21:00
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
     2
\documentclass[presentation]{beamer}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     3
\usepackage[latin1]{inputenc}
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     4
\usepackage[T1]{fontenc}
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
     5
\usepackage{fixltx2e}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
     6
\usepackage{graphicx}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
     7
\usepackage{longtable}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
     8
\usepackage{float}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
     9
\usepackage{wrapfig}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    10
\usepackage{soul}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    11
\usepackage{textcomp}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    12
\usepackage{marvosym}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    13
\usepackage{wasysym}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    14
\usepackage{latexsym}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    15
\usepackage{amssymb}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    16
\usepackage{hyperref}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    17
\tolerance=1000
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    18
\usepackage[english]{babel} \usepackage{ae,aecompl}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    19
\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    20
\usepackage{listings}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    21
\lstset{language=Python, basicstyle=\ttfamily\bfseries,
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    22
commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    23
showstringspaces=false, keywordstyle=\color{blue}\bfseries}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    24
\providecommand{\alert}[1]{\textbf{#1}}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    25
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    26
\title{I/O}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    27
\author{FOSSEE}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    28
\date{}
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    29
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    30
\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    31
\begin{document}
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    32
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    33
\maketitle
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    34
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    35
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    36
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    37
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    38
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    39
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    40
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    41
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    42
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    43
\begin{frame}
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    44
\frametitle{Outline}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    45
\label{sec-1}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    46
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    47
\begin{itemize}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    48
\item Showing output to the user.
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    49
\item Taking input from the user.
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    50
\end{itemize}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    51
\end{frame}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    52
\begin{frame}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    53
\frametitle{Question 1}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    54
\label{sec-2}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    55
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    56
  What happens when you do \texttt{print "x is \%d y is \%f" \%(x, y)}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    57
\end{frame}
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    58
\begin{frame}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    59
\frametitle{Solution 1}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    60
\label{sec-3}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    61
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    62
  \texttt{int} value of \texttt{x} and \texttt{float} value of \texttt{y} are printed corresponding to the
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    63
  modifiers used in the \texttt{print} statement
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    64
\end{frame}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    65
\begin{frame}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    66
\frametitle{Question 2}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    67
\label{sec-4}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    68
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    69
  Enter the number 5.6 as input and store it in a variable called
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    70
  \texttt{c}. 
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    71
\end{frame}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    72
\begin{frame}[fragile]
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    73
\frametitle{Solution 2}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    74
\label{sec-5}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    75
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    76
\lstset{language=Python}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    77
\begin{lstlisting}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    78
In []: c = raw_input() 
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    79
5.6
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    80
In []: c
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    81
\end{lstlisting}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    82
\end{frame}
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    83
\begin{frame}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    84
\frametitle{Question 3}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    85
\label{sec-6}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    86
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    87
  What happens when you do not enter anything and hit enter
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    88
\end{frame}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    89
\begin{frame}[fragile]
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    90
\frametitle{Solution 3}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    91
\label{sec-7}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    92
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    93
\lstset{language=Python}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    94
\begin{lstlisting}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    95
In []: c = raw_input() 
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    96
<RET>
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    97
In []: c
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    98
\end{lstlisting}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
    99
\end{frame}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   100
\begin{frame}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   101
\frametitle{Question 4}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   102
\label{sec-8}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   103
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   104
  How do you display a prompt and let the user enter input in a new line
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   105
\end{frame}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   106
\begin{frame}[fragile]
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   107
\frametitle{Solution 4}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   108
\label{sec-9}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   109
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   110
\lstset{language=Python}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   111
\begin{lstlisting}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   112
In []: ip = raw_input("Please enter a number in the next line\n> ")
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   113
\end{lstlisting}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   114
\end{frame}
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   115
\begin{frame}
276
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   116
\frametitle{Summary}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   117
\label{sec-10}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   118
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   119
  You should now be able to --
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   120
\begin{itemize}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   121
\item Print a value ``as is''
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   122
\item Print a value using using modifiers
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   123
\item Accept input from user
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   124
\item Display a prompt before accepting input
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   125
\end{itemize}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   126
\end{frame}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   127
\begin{frame}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   128
\frametitle{Thank you!}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   129
\label{sec-11}
89437325b326 Slides for I/O LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 236
diff changeset
   130
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   131
  \begin{block}{}
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   132
  \begin{center}
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   133
  This spoken tutorial has been produced by the
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   134
  \textcolor{blue}{FOSSEE} team, which is funded by the 
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   135
  \end{center}
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   136
  \begin{center}
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   137
    \textcolor{blue}{National Mission on Education through \\
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   138
      Information \& Communication Technology \\ 
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   139
      MHRD, Govt. of India}.
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   140
  \end{center}  
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   141
  \end{block}
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   142
\end{frame}
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   143
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   144
\end{document}