getting-started-with-lists/slides.org
author anand
Fri, 12 Nov 2010 00:40:47 +0530
changeset 491 ebfe3a675882
parent 441 430035b678f7
permissions -rw-r--r--
checklist ok for `getting started with lists`
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     1
#+LaTeX_CLASS: beamer
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     2
#+LaTeX_CLASS_OPTIONS: [presentation]
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     3
#+BEAMER_FRAME_LEVEL: 1
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     4
441
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
     5
#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     6
#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
     7
#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
441
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
     8
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
     9
#+LaTeX_CLASS: beamer
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    10
#+LaTeX_CLASS_OPTIONS: [presentation]
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    11
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    12
#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    13
#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    14
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    15
#+LaTeX_HEADER: \usepackage{listings}
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    16
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    17
#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    18
#+LaTeX_HEADER:  commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    19
#+LaTeX_HEADER:  showstringspaces=false, keywordstyle=\color{blue}\bfseries}
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    20
406
a534e9e79599 Completed basic data type based on review and improved on slides
Amit Sethi
parents: 322
diff changeset
    21
#+TITLE: Getting started with Lists
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    22
#+AUTHOR: FOSSEE
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    23
#+DATE: 2010-09-14 Tue
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    24
#+EMAIL:     info@fossee.in
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    25
441
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    26
#+DESCRIPTION: 
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    27
#+KEYWORDS: 
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    28
#+LANGUAGE:  en
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    29
#+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    30
#+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    31
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    32
441
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    33
* Outline 
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    34
 - How to create lists
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    35
 - Structure of lists  
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    36
 - Access list elements
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    37
 - Append elements to lists
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    38
 - Deleting elements from lists
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    39
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    40
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    41
* Question 1 
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    42
  - What happens when you do nonempty[-1].
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    43
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    44
* Solution 1
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    45
  - It gives the last element , 1.234
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    46
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    47
* Questions
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    48
  - What is the syntax to get the element 'and' 
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    49
in the list,listinlist ?
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    50
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    51
441
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    52
  - How would you get 'and' using negative indices?
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    53
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    54
* Solutions
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    55
#+begin_src python
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    56
  
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    57
  listinlist[1]
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    58
  listinlist[-5]
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    59
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    60
#+end_src python
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    61
* Questions
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    62
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    63
  - Remove the third element from the list, listinlist.   
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    64
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    65
  - Remove 'and' from the list, listinlist.
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    66
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    67
* Solutions
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    68
#+begin_src python
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    69
  
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    70
  del(listinlist[2])
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    71
  listinlist.remove('and')
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    72
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    73
#+end_src python
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    74
* Summary
441
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    75
#+begin_src python
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    76
  
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    77
  l=[1,2,3,4]
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    78
  l[-1]
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    79
  l.append(5)
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    80
  del(l[2])
441
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    81
  l.remove(2)
322
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    82
  len(l)
3cacbcad4c42 Adding plotting data
amit
parents:
diff changeset
    83
441
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    84
#+end_src python
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    85
* Thank you!
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    86
#+begin_latex
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    87
  \begin{block}{}
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    88
  \begin{center}
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    89
  This spoken tutorial has been produced by the
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    90
  \textcolor{blue}{FOSSEE} team, which is funded by the 
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    91
  \end{center}
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    92
  \begin{center}
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    93
    \textcolor{blue}{National Mission on Education through \\
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    94
      Information \& Communication Technology \\ 
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    95
      MHRD, Govt. of India}.
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    96
  \end{center}  
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    97
  \end{block}
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    98
#+end_latex
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
    99
430035b678f7 Exercises for getting started with lists and some changes based on review
Amit Sethi
parents: 406
diff changeset
   100