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