author | Nishanth <nishanth@fossee.in> |
Mon, 11 Oct 2010 13:42:52 +0530 | |
changeset 297 | bef342784a40 |
parent 281 | d91133654fc8 |
child 427 | c193744340ba |
permissions | -rw-r--r-- |
281 | 1 |
% Created 2010-10-10 Sun 23:53 |
2 |
\documentclass[presentation]{beamer} |
|
233
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
3 |
\usepackage[latin1]{inputenc} |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
4 |
\usepackage[T1]{fontenc} |
281 | 5 |
\usepackage{fixltx2e} |
6 |
\usepackage{graphicx} |
|
7 |
\usepackage{longtable} |
|
8 |
\usepackage{float} |
|
9 |
\usepackage{wrapfig} |
|
10 |
\usepackage{soul} |
|
11 |
\usepackage{textcomp} |
|
12 |
\usepackage{marvosym} |
|
13 |
\usepackage{wasysym} |
|
14 |
\usepackage{latexsym} |
|
15 |
\usepackage{amssymb} |
|
16 |
\usepackage{hyperref} |
|
17 |
\tolerance=1000 |
|
18 |
\usepackage[english]{babel} \usepackage{ae,aecompl} |
|
19 |
\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet} |
|
20 |
\usepackage{listings} |
|
21 |
\lstset{language=Python, basicstyle=\ttfamily\bfseries, |
|
22 |
commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen}, |
|
23 |
showstringspaces=false, keywordstyle=\color{blue}\bfseries} |
|
24 |
\providecommand{\alert}[1]{\textbf{#1}} |
|
233
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
25 |
|
281 | 26 |
\title{Sets} |
27 |
\author{FOSSEE} |
|
233
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
28 |
\date{} |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
29 |
|
281 | 30 |
\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent} |
233
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
31 |
\begin{document} |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
32 |
|
281 | 33 |
\maketitle |
34 |
||
35 |
||
36 |
||
37 |
||
38 |
||
39 |
||
40 |
||
41 |
||
42 |
||
233
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
43 |
\begin{frame} |
281 | 44 |
\frametitle{Outline} |
45 |
\label{sec-1} |
|
46 |
||
47 |
\begin{itemize} |
|
48 |
\item Defining Sets |
|
49 |
\item Operations on sets |
|
50 |
\end{itemize} |
|
233
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
51 |
\end{frame} |
281 | 52 |
\begin{frame} |
53 |
\frametitle{Question 1} |
|
54 |
\label{sec-2} |
|
233
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
55 |
|
281 | 56 |
Given a list of marks, \texttt{marks = [20, 23, 22, 23, 20, 21, 23]} list |
57 |
all the duplicates |
|
58 |
\end{frame} |
|
233
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
59 |
\begin{frame}[fragile] |
281 | 60 |
\frametitle{Solution 1} |
61 |
\label{sec-3} |
|
233
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
62 |
|
281 | 63 |
\lstset{language=Python} |
64 |
\begin{lstlisting} |
|
65 |
marks = [20, 23, 22, 23, 20, 21, 23] |
|
66 |
marks_set = set(marks) |
|
67 |
for mark in marks_set: |
|
68 |
marks.remove(mark) |
|
233
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
69 |
|
281 | 70 |
# we are now left with only duplicates in the list marks |
71 |
duplicates = set(marks) |
|
72 |
\end{lstlisting} |
|
233
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
73 |
\end{frame} |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
74 |
\begin{frame} |
281 | 75 |
\frametitle{Summary} |
76 |
\label{sec-4} |
|
77 |
||
78 |
You should now be able to -- |
|
79 |
\begin{itemize} |
|
80 |
\item make sets from lists |
|
81 |
\item input sets directly |
|
82 |
\item perform operations like union, intersection, symmetric difference |
|
83 |
\item check if a subset of another |
|
84 |
\item check containership, length and other properties similar to lists |
|
85 |
\end{itemize} |
|
86 |
\end{frame} |
|
87 |
\begin{frame} |
|
88 |
\frametitle{Thank you!} |
|
89 |
\label{sec-5} |
|
90 |
||
233
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
91 |
\begin{block}{} |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
92 |
\begin{center} |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
93 |
This spoken tutorial has been produced by the |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
94 |
\textcolor{blue}{FOSSEE} team, which is funded by the |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
95 |
\end{center} |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
96 |
\begin{center} |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
97 |
\textcolor{blue}{National Mission on Education through \\ |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
98 |
Information \& Communication Technology \\ |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
99 |
MHRD, Govt. of India}. |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
100 |
\end{center} |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
101 |
\end{block} |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
102 |
\end{frame} |
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
103 |
|
ab748264f726
Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff
changeset
|
104 |
\end{document} |