diff options
Diffstat (limited to 'getting_started_with_lists')
-rw-r--r-- | getting_started_with_lists/script.odt | bin | 0 -> 34989 bytes | |||
-rw-r--r-- | getting_started_with_lists/script.rst | 77 | ||||
-rw-r--r-- | getting_started_with_lists/script.txt | 230 | ||||
-rw-r--r-- | getting_started_with_lists/slides.tex | 248 |
4 files changed, 390 insertions, 165 deletions
diff --git a/getting_started_with_lists/script.odt b/getting_started_with_lists/script.odt Binary files differnew file mode 100644 index 0000000..065a8d2 --- /dev/null +++ b/getting_started_with_lists/script.odt diff --git a/getting_started_with_lists/script.rst b/getting_started_with_lists/script.rst index d3d528e..43bb612 100644 --- a/getting_started_with_lists/script.rst +++ b/getting_started_with_lists/script.rst @@ -1,58 +1,32 @@ -.. Objectives -.. ---------- - -.. By the end of this tutorial, you will be able to - -.. Create Lists. -.. Access List elements. -.. Append elemets to list -.. Delete list elemets - -.. 1. getting started with ipython - - - -.. Prerequisites -.. ------------- - -.. 1. getting started with strings -.. #. getting started with lists -.. #. basic datatypes - -.. Author : Amit - Internal Reviewer : Anoop Jacob Thomas <anoop@fossee.in> - External Reviewer : - Language Reviewer : Bhanukiran - Checklist OK? : <12-11-2010, Anand, OK> [2010-10-05] - - Script ------ .. L1 -{{{ Show the first slide containing title, name of the production -team along with the logo of MHRD }}} +{{{ Show the Title slide }}} .. R1 Hello friends and welcome to the tutorial on "Getting started with -lists". +Lists". .. L2 -{{{ Show slide with objectives }}} +{{{ Show 'objectives' slide }}} .. R2 -In this tutorial we will be getting acquainted with a python data -structure called lists. At the end of this tutorial, you will be able to, 1. Create lists #. Access list elements #. Append elements to lists #. Delete elements from lists + #. Find length of the lists + +.. L3 + +{{{ Show 'Lists' slide }}} .. R3 @@ -60,37 +34,38 @@ List is a compound data type, it can contain data of mutually different datatypes. List is also a sequence data type where all the elements are arranged in a specific order. -Start the ipython interpreter and first create an empty list with no -elements. +.. L4 -.. L3 -:: - ipython empty = [] type(empty) .. R4 - -This is an empty list without any elements. -Lets define a non-empty list as: +Let us start the IPython interpreter and creat an empty list. So, type on the +terminal ipython. Now, to create an empty list we say empty is equal to empty +square brackets. Remember that 'empty' is just a name of the list, we could give +any name required. Further, let us check the data type of the 'empty'. For this +we say, type(empty) and hitenter. As we can see 'empty' variable is of type +list. -.. L4 -:: +.. L5 +:: nonempty = ['spam', 'eggs', 100, 1.234] .. R5 + +That was about empty list. Now, let us define a non-empty list with some +elements in it. So, we say, nonempty is equal to within square brackets in +single quotes spam coma in single quotes eggs coma hundred coma one point two +three four. + -Thus, the simplest way of creating a list is typing out a sequence -of comma-separated values (or items) between two square brackets. +.. L4 + +.. R5 -As we can see, lists can contain different kinds of data. In the -previous example 'spam' and 'eggs' are strings whereas 100 and 1.234 are -integer and float respectively. Thus, we can put elements of different -datatypes in lists including lists itself. This property makes lists -heterogeneous data structures. Let us include a list within a list. diff --git a/getting_started_with_lists/script.txt b/getting_started_with_lists/script.txt new file mode 100644 index 0000000..825da3a --- /dev/null +++ b/getting_started_with_lists/script.txt @@ -0,0 +1,230 @@ + +{| style="border-spacing:0;" +| style="border-top:0.05pt double #808080;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| <center>'''Visual Cue'''</center> +| style="border:0.05pt double #808080;padding:0.049cm;"| <center>'''Narration'''</center> + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 1 + +Title Slide +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Hello friends and welcome to the tutorial on "Getting started with lists". + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 2 + +Objectives +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| In this tutorial we will be getting acquainted with a python data structure called lists. At the end of this tutorial, you will be able to, + +# Create lists +# Access list elements +# Append elements to lists +# Delete elements from lists +# Find out length of lists + + + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 3 + +Lists +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| List is a compound data type, it can contain data of mutually different data types. List is also a sequence data type where all the elements are arranged in a specific order. + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| ipython + +<nowiki>empty = []</nowiki> + +type(empty) +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Lets start with creating an empty list. So, start the ipython interpreter and first create an empty list with no elements. Go to the '''terminal''', type '''ipython''' and hit enter. Now, to create an empty list we say '''empty''' ''is equal to empty square brackets''. Note that '''empty''' is just a name of the variable. To check the type of the variable '''empty''' we say type ''within round brackets'' name of the variable which in our case is '''empty'''''.'' As you can see the type is '''list''' + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| <nowiki>nonempty = ['spam', 'eggs', 100, 1.234]</nowiki> +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| That was about creating an empty list. Now, lets create a non empty list with some values in it. So, we say '''nonempty''''' is equal to within square brackets, in single quotes'' '''spam''' coma ''in single quotes'' '''eggs''' coma hundred coma one point two three four. + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| <nowiki>listinlist=[[4,2,3,4],'and', 1, 2, 3, 4]</nowiki> +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Thus, the simplest way of creating a list is typing out a sequence of comma-separated values (or items) between two square brackets. + +As we can see, lists can contain different kinds of data. In the previous example ''''spam'''' and ''''eggs'''' are strings whereas '''100''' and '''1.234''' is '''integer''' and '''float''' respectively. Thus, we can put elements of different data types in lists including lists itself. This property makes lists heterogeneous data structures. + +Let us include a list within a list. So, type '''listiinlist''' ''is equal to within square brackets opening sqare bracket'' four coma two coma three coma four ''closing square bracket'' coma ''in single quotes'' '''and''' coma one coma two coma three coma four + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| <nowiki>nonempty[0]</nowiki> + +<nowiki>nonempty[1]</nowiki> + +<nowiki>nonempty[3]</nowiki> +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| We can access an element of a list using its corresponding index. Index of the first element of a list is 0. So for the list nonempty, '''nonempty '''''within square brackets'' zero gives the first element, '''nonempty''' ''within square brackets one ''gives the second element and so on. + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 4 + +Excercise 1 +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Pause the video here, try out the following exercise and resume the video. + +What happens when you do '''nonempty '''''within square brackets minus ''one. + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Switch to the terminal + +<nowiki>nonempty[-1]</nowiki> +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| As you can see you get the last element which is 1.234. + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| <nowiki>nonempty[-2]</nowiki> + +<nowiki>nonempty[-4]</nowiki> +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| In '''python''' negative indices are used to access elements from the end. -1 gives the last element which is the 4th element , -2 gives second element to last and -4 gives the fourth from the last which, in this case, is the first element. + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| nonempty.append('onemore') + +nonempty + +nonempty.append(6) + +nonempty +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| We can also append elements to the end of a list using the ''append'' function. So, type '''nonempty''' ''dot append within round brackets in single quotes'' '''onemore'''. Then type '''nonempty''', as you can see the element '''onemore''' has been appended to the list. Type '''nonempty''' ''within square brackets'' '''six'''. Type '''nonempety '''and you can see '''six''' is appended to the list. + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 5 + +Exercise 2 +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Please, pause the video here. Do the following exercise and then continue. + +# What is the syntax to get the element ''''and'''' in the list, '''listinlist'' '''''? +# How would you get ''''and'''' using negative indices? + + + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 6 + +Solution 2 +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| The solution is on your screen + +To get the element ''''''''and'''''''' from the list '''listlinlist''''' ''se say '''listinlist''''' within square brackets'' '''one'''. Next, to access the element ''''''''and'''''' ''using negative index, we say '''listinlist''''' within square brackets'' minus five + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| <nowiki>del(nonempty[1])</nowiki> +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Just like we can append elements to a list, we can also remove them. There are two ways of doing it. One is by using index. We can use the '''del''' function to do this. So, type '''del''' ''within round brackets'' '''nonempty''' within ''square brackets'' '''one'''. + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| nonempty.remove(100) +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| The function '''del''' deletes the element at index one, i.e the second element of the list which is ''''eggs''''. + +The other way is removing element is by content. Lets say one wishes to delete 100 from nonempty list. For this, one could use the function remove. So, type '''nonempty''' ''dot'' '''remove''' ''within round brackets'' hundred. + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| nonempty.append('spam') + +nonempty + +nonempty.remove('spam') + +nonempty +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| But what if there were two 100's. To check that lets do a small experiment. We add one more element ''''spam'''' to our list '''nonempty'''. To do this we say '''nonempty''' ''dot'' '''append''' ''within round brackets'' in ''single quotes'' '''spam'''. Now, we remove the element '''spam''' using the '''remove''' function. If we now check, we will see that the first occurrence ''''spam'''' is removed and therefore the function '''remove''''' ''removes the first occurrence of the element in the sequence and leaves others untouched. One should remember this, that while '''del''' removes by index number, '''remove''''' ''removes on the basis of content being passed on. + + + + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 7 + +Exercise 3 +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Pause the video here, try out the following exercise and resume the video. + +# Remove the third element from the list, '''listinlist'''. +# Remove 'and' from the list, '''listinlist'''. + + + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 8 + +Solution 3 +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| The solution is on your screen. + +'''Del '''''within round brackets '''''listinlist '''''within square brackets '''''two, '''this will remove the third element from the list '''listinlist. '''To remove the element '''and '''you can do '''listinlist '''''dot '''''remove '''''within round brackets in single quotes '''''and''' + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| len(nonempty) +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Let us move further. We can use '''len''' function to check the number of elements in the list. Let us find out the length of the list ''''nonempty''''. Type '''len''' ''withing round brackets'' '''nonempty'''. It returns the number of elements in the list nonempty. + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 9 + +Summary +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| This brings us to the end of this tutorial. In this tutorial, we have learnt to, + +# Create lists. +# Access lists using their index numbers. +# Append elements to list using the function '''append'''. +# Delete Element from lists by specifying the index number of the element to be deleted in the '''del''' function. +# Delete element from list by content using '''remove''' function. +# Find out the list length using '''len''' function. + + + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 10 + +Evaluation +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Here are some self assessment questions for you to solve + +# How do you create an empty list ? +# Can you have a list inside a list ? +# How would you access the end of a list without finding its length? + + + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 11 + +Solutions +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| And the answers, + +# We create an empty list just by leaving the space inside the square brackets empty.'''Empty''' ''is equal to empty square brackets''. +# +# Yes. List can contain all the other data types, including list. +# +# We can access the last element of the list without knowing its length using negative indices. + + + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 12
+ +FOSSEE
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| FOSSEE is Free and Open-source Software for Science and Engineering Education. The goal of
this project is to enable all to use open source
software tools. For more details, please visit the
given link.
+ +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 13 + +About the Spoken Tutorial Project +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Watch the video available at the following link. It summarizes the Spoken Tutorial project. If you do
not have good bandwidth, you can download and
watch it. + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 14 + +Spoken Tutorial Workshop +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| The Spoken Tutorial Project Team conducts
SELF workshops using spoken tutorials, gives
certificates to those who pass an online test.
For more details, you may write to contact@spoken-tutorial.org + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 15 + +Acknowledgements +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Spoken Tutorial Project is a part of the "Talk to a
Teacher" project. It is supported by the National
Mission on Education through ICT, MHRD,
Government of India. More information on this
mission is available at the given link.
+ + + + +|- +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 16 + +Thank You +| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Hope you have enjoyed this tutorial and found it
useful. Thank you! + +|} + diff --git a/getting_started_with_lists/slides.tex b/getting_started_with_lists/slides.tex index 01f8b10..c705a4c 100644 --- a/getting_started_with_lists/slides.tex +++ b/getting_started_with_lists/slides.tex @@ -1,70 +1,68 @@ -% Created 2011-05-24 Tue 09:52 -\documentclass[presentation]{beamer} -\usepackage[utf8]{inputenc} +\documentclass[17pt]{beamer} +%\documentclass{beamer} +\usetheme{Madrid} +\useoutertheme{noslidenum} +\setbeamertemplate{navigation symbols}{} +\usepackage{beamerthemesplit} +\usepackage{ae,aecompl} +\usepackage[scaled=.95]{helvet} +\usepackage[english]{babel} +\usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} -\usepackage{fixltx2e} -\usepackage{graphicx} -\usepackage{longtable} -\usepackage{float} -\usepackage{wrapfig} -\usepackage{soul} -\usepackage{textcomp} -\usepackage{marvosym} -\usepackage{wasysym} -\usepackage{latexsym} -\usepackage{amssymb} -\usepackage{hyperref} -\tolerance=1000 -\usepackage[english]{babel} \usepackage{ae,aecompl} -\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet} +\usepackage{mathpazo,courier,euler} \usepackage{listings} -\lstset{language=Python, basicstyle=\ttfamily\bfseries, -commentstyle=\color{red}\itshape, stringstyle=\color -{darkgreen}, -showstringspaces=false, keywordstyle=\color{blue}\bfseries} -\providecommand{\alert}[1]{\textbf{#1}} +\lstset{language=sh, + basicstyle=\ttfamily\bfseries, + showstringspaces=false, + keywordstyle=\color{black}\bfseries} + +% theme split +\usepackage{verbatim} +\newenvironment{colorverbatim}[1][]% +{% +\color{blue} +\verbatim +}% +{% +\endverbatim +}% + +\definecolor{NavyBlue}{RGB}{0, 76, 153} +\setbeamercolor{structure}{fg=NavyBlue} +\author[FOSSEE]{} +\institute[IIT Bombay]{} +\date[]{} + +% logo +\logo{\includegraphics[height=1.30cm]{../images/3t-logo.pdf}} +\logo{\includegraphics[height=0.6cm]{../images/fossee-logo.png} + +\hspace{200pt} +\includegraphics[scale=0.5]{../images/fossee-logo.png}\\ +\hspace{275pt} +\includegraphics[scale=0.9]{../images/3t-logo.pdf}} -\title{} -\author{FOSSEE} -\date{2010-09-14 Tue} - -\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent} \begin{document} - - - - - - - - - - - +\sffamily \bfseries +\title +[Getting Started With Lists] +{Getting Started With Lists} +\author +[FOSSEE, IIT - Bombay] +{\small Talk to a Teacher\\{\color{blue}\url{http://spoken-tutorial.org}}\\National Mission on Education + through ICT\\{\color{blue}\url{http://sakshat.ac.in}} \\ [0.8cm]Script by: Hardik Ghaghada \\ Narration by: \\ + [0.5cm] +{\small 15 May 2013}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} - -\begin{center} -\vspace{12pt} -\textcolor{blue}{\huge Getting started with Lists} -\end{center} -\vspace{18pt} -\begin{center} -\vspace{10pt} -\includegraphics[scale=0.95]{../images/fossee-logo.png}\\ -\vspace{5pt} -\scriptsize Developed by FOSSEE Team, IIT-Bombay. \\ -\scriptsize Funded by National Mission on Education through ICT\\ -\scriptsize MHRD,Govt. of India\\ -\includegraphics[scale=0.30]{../images/iitb-logo.png}\\ -\end{center} + \titlepage \end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{Objectives} -\label{sec-2} - At the end of this tutorial, you will be able to, - \begin{itemize} \item Create lists \item Access list elements @@ -72,108 +70,130 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries} \item Delete elements from lists \end{itemize} \end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame} +\frametitle{Lists} +List is a compound data type, it can contain data of mutually +different datatypes. List is also a sequence data type where all the +elements are arranged in a specific order. +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{Exercise 1} -\label{sec-3} - - \begin{itemize} \item What happens when you do nonempty[-1]. \end{itemize} \end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{Exercise 2} -\label{sec-4} - - \begin{itemize} \item What is the syntax to get the element `and' in the list,listinlist ? \item How would you get `and' using negative indices? \end{itemize} \end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame}[fragile] \frametitle{Solution 2} -\label{sec-5} - - \lstset{language=Python} \begin{lstlisting} - listinlist[1] listinlist[-5] \end{lstlisting} \end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} \frametitle{Exercise 3} -\label{sec-6} - - - \begin{itemize} \item Remove the third element from the list, listinlist. \item Remove `and' from the list, listinlist. \end{itemize} \end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame}[fragile] \frametitle{Solution 3} -\label{sec-7} - \lstset{language=Python} \begin{lstlisting} - del(listinlist[2]) listinlist.remove('and') \end{lstlisting} \end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame}[fragile] + \frametitle{Summary} + In this tutorial we have learnt how to, + \begin{itemize} + \item Create lists + \item Access elements + \item Use ``append'' function + \item Use ``del'' function + \item Use ``remove'' function. + \item Use ``len'' function. + \end{itemize} +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame}[fragile] + \frametitle{Evaluation} + \begin{enumerate} + \item How do you create an empty list ? + \vspace{8pt} + \item Can you have a list inside a list ? + \vspace{8pt} + \item How would you access the last element of a list without finding its length? + \end{enumerate} +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame}[fragile] + \frametitle{Solutions} + \begin{enumerate} + \item empty=[] + \vspace{8pt} + \item Yes we can have list inside list\\ + \vspace{8pt} + \item Use negative index to access the last element of the list + \end{enumerate} +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} -\frametitle{Summary} -\label{sec-8} - - In this tutorial, we have learnt to – - +\frametitle{FOSSEE} +{\color{NavyBlue}Free and Open Source Software for \\Education} \\ \begin{itemize} -\item Create lists. -\item Access lists using their index numbers. -\item Append elements to list using the function ``append``. -\item Delete Element from lists by specifying the index number of the - element to be deleted in the ``del`` function. -\item Delete element from list by content using ``remove`` function. -\item Find out the list length using the ``len`` function. +\item To enable the use of free and open source software tools +\item For more details, please visit: {\color{blue}\url{http://fossee.in/}} \end{itemize} \end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} -\frametitle{Evaluation} -\label{sec-9} - - -\begin{enumerate} -\item How do you create an empty list? -\vspace{8pt} -\item Can you have a list inside a list ? -\vspace{8pt} -\item How would you access the end of a list without finding its length? -\end{enumerate} +\frametitle{About the Spoken Tutorial Project} +\begin{itemize} +\item Watch the video available at {\color{blue}\url{http://spoken-tutorial.org /What\_is\_a\_Spoken\_Tutorial}} +\item It summarises the Spoken Tutorial project +\item If you do not have good bandwidth, you can download and watch it +\end{itemize} \end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} -\frametitle{Solutions} -\label{sec-10} - - -\begin{enumerate} -\item empty=[] -\vspace{8pt} -\item Yes\\ -list\_in\_list=[2.3,[2,4,6],'string,'all datatypes can be there'] -\vspace{8pt} -\item Using negative indices\\ -nonempty = ['spam', `eggs', 100, 1.234]\\ - nonempty[-1] -\end{enumerate} +\frametitle{Spoken Tutorial Workshops}The Spoken Tutorial Project Team +\begin{itemize} +\item Conducts workshops using spoken tutorials +\item Gives certificates to those who pass an online test +\item For more details, please write to \\ \hspace {0.5cm}{\color{blue}contact@spoken-tutorial.org} +\end{itemize} +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame} +\frametitle{Acknowledgements} +\begin{itemize} +\item Spoken Tutorial Project is a part of the Talk to a Teacher project +\item Supported by the National Mission on Education through ICT, MHRD, Government of India +\item More information: \\{\color{blue}\url{http://spoken-tutorial.org/NMEICT-Intro}} +\end{itemize} \end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame} - \begin{block}{} + \begin{block}{} \begin{center} \textcolor{blue}{\Large THANK YOU!} \end{center} @@ -181,9 +201,9 @@ nonempty = ['spam', `eggs', 100, 1.234]\\ \begin{block}{} \begin{center} For more Information, visit our website\\ - \url{http://fossee.in/} + {\color{blue}\url{http://fossee.in/}} \end{center} \end{block} \end{frame} - +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \end{document} |