<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Python-3.4.3%2FC3%2FManipulating-lists%2FEnglish-timed</id>
		<title>Python-3.4.3/C3/Manipulating-lists/English-timed - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Python-3.4.3%2FC3%2FManipulating-lists%2FEnglish-timed"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python-3.4.3/C3/Manipulating-lists/English-timed&amp;action=history"/>
		<updated>2026-05-04T16:58:53Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Python-3.4.3/C3/Manipulating-lists/English-timed&amp;diff=47672&amp;oldid=prev</id>
		<title>PoojaMoolya: Created page with &quot;{| border=1 | &lt;center&gt;'''Time'''&lt;/center&gt;  | &lt;center&gt;'''Narration'''&lt;/center&gt;   |-  | 00:01 | Welcome to the spoken tutorial on '''Manipulating Lists'''.   |-  | 00:06 | In th...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python-3.4.3/C3/Manipulating-lists/English-timed&amp;diff=47672&amp;oldid=prev"/>
				<updated>2019-06-04T06:22:30Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| border=1 | &amp;lt;center&amp;gt;&amp;#039;&amp;#039;&amp;#039;Time&amp;#039;&amp;#039;&amp;#039;&amp;lt;/center&amp;gt;  | &amp;lt;center&amp;gt;&amp;#039;&amp;#039;&amp;#039;Narration&amp;#039;&amp;#039;&amp;#039;&amp;lt;/center&amp;gt;   |-  | 00:01 | Welcome to the spoken tutorial on &amp;#039;&amp;#039;&amp;#039;Manipulating Lists&amp;#039;&amp;#039;&amp;#039;.   |-  | 00:06 | In th...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| border=1&lt;br /&gt;
| &amp;lt;center&amp;gt;'''Time'''&amp;lt;/center&amp;gt; &lt;br /&gt;
| &amp;lt;center&amp;gt;'''Narration'''&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 00:01&lt;br /&gt;
| Welcome to the spoken tutorial on '''Manipulating Lists'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 00:06&lt;br /&gt;
| In this tutorial, we will learn about &lt;br /&gt;
&lt;br /&gt;
'''slicing''' and '''striding''' of '''lists''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 00:12&lt;br /&gt;
| '''Sort''' and '''reverse lists'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 00:15&lt;br /&gt;
| To record this tutorial, I am using  '''Ubuntu Linux 16.04''' operating system &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 00:23&lt;br /&gt;
|  '''Python 3.4.3''' &lt;br /&gt;
&lt;br /&gt;
and '''IPython 5.1.0''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 00:30&lt;br /&gt;
| To practise this tutorial, you should know how to run basic '''Python '''commands on the '''ipython console '''and  use '''lists''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 00:41&lt;br /&gt;
| If not, see the relevant '''Python '''tutorials on this website. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 00:46&lt;br /&gt;
| We have already learnt about '''list''' and how to access individual '''elements''' in the '''list.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 00:53&lt;br /&gt;
| Now we will see about '''slicing''' of '''lists'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 00:57&lt;br /&gt;
| The syntax for '''slicing''' is '''p '''''inside square brackets''''' start '''''colon '''''stop'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 01:04&lt;br /&gt;
| It returns all the '''elements''' of '''p''' between '''start''' and '''stop '''values. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 01:11&lt;br /&gt;
| The '''element''' with the '''stop index''' value will not be included. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 01:16&lt;br /&gt;
| Let us start '''ipython.''' &lt;br /&gt;
&lt;br /&gt;
Open the '''terminal.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 01:21&lt;br /&gt;
| Type '''ipython3 '''and press '''Enter.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 01:27&lt;br /&gt;
| From here onwards, remember to press the '''Enter''' key after typing every command on the '''terminal'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 01:34&lt;br /&gt;
| Let us understand the '''slicing''' with an example. &lt;br /&gt;
&lt;br /&gt;
Type, '''primes '''''is equal to''''' '''then type as shown. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 01:45&lt;br /&gt;
| Now we will try to obtain all the '''primes''' between 10 and 20 from the above '''list''' of '''primes.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 01:52&lt;br /&gt;
| Type, '''primes '''''inside square brackets''''' 4 '''''colon''''' 8''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 01:59&lt;br /&gt;
| Recall that the '''start''' index value is 0. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 02:03&lt;br /&gt;
| Observe that the first '''element''' we want is 11 which has index 4 in the list. &lt;br /&gt;
&lt;br /&gt;
So, '''start''' value is 4. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 02:12&lt;br /&gt;
| Also, 19 is the last '''element''' we require which has '''index''' 7 in the '''list'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 02:19&lt;br /&gt;
| The '''element''' with '''index''' equal to '''stop value''' will not be included. &lt;br /&gt;
&lt;br /&gt;
So, '''end''' value is 8. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 02:26&lt;br /&gt;
| Pause the video. &lt;br /&gt;
&lt;br /&gt;
Try this exercise and then resume the video. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 02:32&lt;br /&gt;
| Obtain the '''primes''' less than 10, from the list '''primes'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 02:37&lt;br /&gt;
| Switch back to '''terminal''' for the solution &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 02:41&lt;br /&gt;
| Type, '''primes '''''inside square brackets''''' 0 '''''colon '''''4 ''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 02:47&lt;br /&gt;
| Observe that in this case, our '''start''' value is 0. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 02:52&lt;br /&gt;
| 7 is the last '''element''' we require which has '''index''' 3 in the '''list'''. &lt;br /&gt;
&lt;br /&gt;
So, the '''end''' value is 4. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 03:01&lt;br /&gt;
| Next we will learn to use '''step value''' in slicing. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 03:06&lt;br /&gt;
| Type 0 to 13 in a '''list''' and assign it to a variable '''num''' as shown. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 03:13&lt;br /&gt;
| Let us say, we want all the odd numbers less than 10 from the '''list num'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 03:19&lt;br /&gt;
| We will specify the '''step value''' in which the '''slice''' must be obtained. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 03:25&lt;br /&gt;
| Type '''num '''''inside square brackets '''''1''''' colon '''''10''''' colon '''''2''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 03:31&lt;br /&gt;
| We have to start from '''element''' with '''index''' 1 upto '''index''' 10 in steps of 2. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 03:39&lt;br /&gt;
| It is called '''striding''' of '''list'''. &lt;br /&gt;
&lt;br /&gt;
Press '''Enter '''to get the output. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 03:45&lt;br /&gt;
| We got the odd numbers less than 10. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 03:48&lt;br /&gt;
| When no '''step''' is specified, it is assumed to be 1. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 03:53&lt;br /&gt;
| Similarly, there are default values for '''start''' and '''stop '''as well. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 03:59&lt;br /&gt;
| Type, '''num '''''inside square brackets colon '''''10''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 04:04&lt;br /&gt;
| It gives the first 10 elements of the list. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 04:08&lt;br /&gt;
| If we don't specify the '''start value''', the first '''element''' of the '''list''' is taken as starting. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 04:15&lt;br /&gt;
| Type, '''num '''''inside square brackets '''''10''''' colon '' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 04:21&lt;br /&gt;
| This gives us all the '''elements''' from 10th '''element '''to the end. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 04:26&lt;br /&gt;
| If we don't specify the '''stop value''', the elements till the last '''index''' of the '''list''' will be returned. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 04:33&lt;br /&gt;
| '''Start''' or '''end''' value can be negative to indicate that they are counted from the end of the '''list'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 04:40&lt;br /&gt;
| Next let us get all the even numbers in the list &amp;quot;'''num'''&amp;quot; &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 04:45&lt;br /&gt;
| Observe that all the even numbers are at even index locations. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 04:51&lt;br /&gt;
| So, type '''num '''''inside square brackets colon colon '''''2''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 04:58&lt;br /&gt;
| We got all the even numbers. &lt;br /&gt;
&lt;br /&gt;
This is called '''striding.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 05:04&lt;br /&gt;
| Pause the video. &lt;br /&gt;
&lt;br /&gt;
Try this exercise and then resume the video. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 05:10&lt;br /&gt;
| Obtain all the multiples of three from the list '''num'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 05:15&lt;br /&gt;
| Switch back to '''terminal''' for the solution &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 05:19&lt;br /&gt;
| Type, '''num '''''inside square brackets colon colon '''''3''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 05:25&lt;br /&gt;
| It gives us every third '''element''' from the '''list''' (i.e) multiples of 3. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 05:31&lt;br /&gt;
| Next let us learn to sort a '''list'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 05:35&lt;br /&gt;
| Type, '''a '''''is equal to inside square brackets '''''5, 1, 6, 7, 7, 10 ''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 05:45&lt;br /&gt;
| '''sort method''' is used to sort a '''list'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 05:49&lt;br /&gt;
| Type, '''a.sort '''''open and close brackets'' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 05:55&lt;br /&gt;
| Type, '''a '''to get the output. &lt;br /&gt;
&lt;br /&gt;
We can see that the contents of the '''list a''' is sorted now. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 06:04&lt;br /&gt;
|  Python provides a built-in '''function''' called '''sorted.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 06:08&lt;br /&gt;
|  '''sorted function''' sorts the '''list''' which is passed as an '''argument''' to it. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 06:14&lt;br /&gt;
| It returns a new '''sorted list. ''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 06:17&lt;br /&gt;
| Again we will assign the same value to '''a''' as shown. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 06:23&lt;br /&gt;
| Type, '''sorted '''''inside brackets''''' a''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 06:28&lt;br /&gt;
| We can store this '''sorted list''' into another '''list variable sa.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 06:34&lt;br /&gt;
| Type, '''sa '''''is equal to''''' sorted '''''inside brackets''''' a''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 06:41&lt;br /&gt;
| To see the '''sorted list''', type '''sa''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 06:46&lt;br /&gt;
| Python also provides the '''reverse''' method which '''reverses''' the '''list''' in place. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 06:52&lt;br /&gt;
| Type, '''r '''''is equal to''''' '''''inside square brackets '''''1 comma 2 comma 3 comma 4 comma 5 ''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 07:01&lt;br /&gt;
| '''r dot reverse '''''open and close brackets'' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 07:06&lt;br /&gt;
| To see the '''list r''', type, '''r''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 07:10&lt;br /&gt;
| We got the '''reverse''' of the '''list'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 07:13&lt;br /&gt;
| The original '''list r''' is changed now. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 07:17&lt;br /&gt;
| To '''reverse''' a '''list''', we can also use '''striding''' with negative '''values'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 07:22&lt;br /&gt;
| Again we will assign the same value to '''r''' as shown. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 07:27&lt;br /&gt;
| Type, '''r '''''inside square brackets colon colon ''minus 1 &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 07:33&lt;br /&gt;
| We can also store this new '''reversed list''' in another''' variable'''. &lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
| 07:38&lt;br /&gt;
| Type, '''ra '''''is equal to''''' r '''''inside square brackets colon colon ''minus 1 &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 07:46&lt;br /&gt;
| To see the '''reversed list''', type '''ra''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 07:51&lt;br /&gt;
| Pause the video. &lt;br /&gt;
&lt;br /&gt;
Try this exercise and then resume the video. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 07:57&lt;br /&gt;
| Given below is the '''list''' of marks of a student in an examination. &lt;br /&gt;
&lt;br /&gt;
Obtain a '''list''' with marks in descending order. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 08:06&lt;br /&gt;
| Switch back to the '''terminal''' for the solution. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 08:10&lt;br /&gt;
| Type the '''list''' of marks as shown. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 08:14&lt;br /&gt;
| To get the marks in descending order type, &lt;br /&gt;
&lt;br /&gt;
'''sorted '''''inside brackets '''''marks '''''inside square brackets'' ''colon colon ''minus '''1''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 08:26&lt;br /&gt;
| We can also get the same output by typing, &lt;br /&gt;
&lt;br /&gt;
'''sorted '''''inside brackets '''''marks comma reverse''''' equal to''''' True''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 08:38&lt;br /&gt;
| This brings us to the end of this tutorial. &lt;br /&gt;
&lt;br /&gt;
Let us summarize. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 08:44&lt;br /&gt;
| In this tutorial, we have learnt to,  Obtain the parts of '''lists''' using '''slicing''' and '''striding'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 08:52&lt;br /&gt;
|  '''Sort lists''' using the '''sort''' method. &lt;br /&gt;
&lt;br /&gt;
Use the method '''reverse''' to reverse the '''lists'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 09:00&lt;br /&gt;
| Here are some self assessment questions for you to solve &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 09:05&lt;br /&gt;
| First. Given the '''list primes'''. How do you obtain the last 4 prime numbers? &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 09:11&lt;br /&gt;
| Second. Given a '''list p''', of unknown length. Obtain the first 3 characters of it. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 09:19&lt;br /&gt;
| And the answers,&lt;br /&gt;
&lt;br /&gt;
First. The last four primes can be obtained from the given '''list''' as, &lt;br /&gt;
&lt;br /&gt;
'''primes''' ''inside square brackets ''minus 4 ''colon'' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 09:30&lt;br /&gt;
| Second. The first 3 characters can be obtained as, &lt;br /&gt;
&lt;br /&gt;
'''p''' ''inside square brackets colon ''3 &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 09:37&lt;br /&gt;
| Please post your timed queries in this forum. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 09:41&lt;br /&gt;
| Please post your general queries on Python in this forum. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
| 09:46&lt;br /&gt;
| FOSSEE team coordinates the TBC project. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|09:50&lt;br /&gt;
| Spoken Tutorial Project is funded by NMEICT, MHRD, Govt. of India. &lt;br /&gt;
&lt;br /&gt;
For more details, visit this website. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|10:01&lt;br /&gt;
| This is Priya from IIT Bombay signing off. Thanks for watching. &lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>PoojaMoolya</name></author>	</entry>

	</feed>