<?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-strings%2FEnglish-timed</id>
		<title>Python-3.4.3/C3/Manipulating-strings/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-strings%2FEnglish-timed"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python-3.4.3/C3/Manipulating-strings/English-timed&amp;action=history"/>
		<updated>2026-05-13T11:57:49Z</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-strings/English-timed&amp;diff=47683&amp;oldid=prev</id>
		<title>Pratik kamble: Created page with &quot;{| border =1 | '''Time ''' |'''Narration'''  |- | 00:01 | Welcome to the spoken tutorial on '''Manipulating''' '''Strings'''.   |- | 00:06 |In this tutorial, we will learn to...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python-3.4.3/C3/Manipulating-strings/English-timed&amp;diff=47683&amp;oldid=prev"/>
				<updated>2019-06-04T12:41:39Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| border =1 | &amp;#039;&amp;#039;&amp;#039;Time &amp;#039;&amp;#039;&amp;#039; |&amp;#039;&amp;#039;&amp;#039;Narration&amp;#039;&amp;#039;&amp;#039;  |- | 00:01 | Welcome to the spoken tutorial on &amp;#039;&amp;#039;&amp;#039;Manipulating&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;Strings&amp;#039;&amp;#039;&amp;#039;.   |- | 00:06 |In this tutorial, we will learn to...&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;
| '''Time '''&lt;br /&gt;
|'''Narration'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 00:01&lt;br /&gt;
| Welcome to the spoken tutorial on '''Manipulating''' '''Strings'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 00:06&lt;br /&gt;
|In this tutorial, we will learn to&lt;br /&gt;
&lt;br /&gt;
Slice a '''string''' and get '''substrings''' out of them&lt;br /&gt;
&lt;br /&gt;
Reverse a '''string'''&lt;br /&gt;
&lt;br /&gt;
Replace characters in a '''string'''&lt;br /&gt;
&lt;br /&gt;
Convert a '''string''' to upper or lowercase and&lt;br /&gt;
&lt;br /&gt;
Join '''list''' '''elements''' to form a '''string'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 00:27&lt;br /&gt;
| To record this tutorial, I am using &lt;br /&gt;
&lt;br /&gt;
'''Ubuntu Linux 16.04''' operating system&lt;br /&gt;
&lt;br /&gt;
'''Python 3.4.3''' and&lt;br /&gt;
&lt;br /&gt;
'''IPython 5.1.0'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|00:43&lt;br /&gt;
|To practise this tutorial, you should know how to use&lt;br /&gt;
&lt;br /&gt;
'''basic datatypes, operators, strings '''and '''lists'''&lt;br /&gt;
&lt;br /&gt;
If not, see the relevant '''Python''' tutorials on this website.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 00:59&lt;br /&gt;
| First let us see about '''string slicing'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:03&lt;br /&gt;
| '''String slicing '''allows us to obtain '''substrings'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:08&lt;br /&gt;
| The syntax for the string slicing is:&lt;br /&gt;
&lt;br /&gt;
'''string_name '''''inside square brackets '''''start '''''colon''''' stop '''or&lt;br /&gt;
&lt;br /&gt;
'''string_name '''''inside square brackets '''''start '''''colon '''''stop '''''colon '''''step'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:24&lt;br /&gt;
| Let us start '''ipython'''. Open the '''terminal.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:29&lt;br /&gt;
| Type '''ipython3 '''and press '''Enter.''' 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:40&lt;br /&gt;
| Let us understand the '''string slicing''' with an example. Type, '''data '''''is equal to inside double quotes''''' python'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:51&lt;br /&gt;
| Type, '''print '''''inside brackets '''''data '''''inside square brackets '''''0 '''''colon '''''3'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:59&lt;br /&gt;
| We get the '''sliced substring''' as '''pyt.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:03&lt;br /&gt;
| Note that, we are '''slicing''' the '''string''' from the '''index''' 0 to 3. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:09&lt;br /&gt;
| By doing so, the string elements from index 3 are not included.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:15&lt;br /&gt;
| Let us create a '''list, week''''' underscore '''''name '''which has names of the days of the week. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|02:21&lt;br /&gt;
|Type as shown. Type, '''s '''''is equal to inside double quotes''''' saturday'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:31&lt;br /&gt;
| We need to check if the first three characters of the given '''string''' exists in the list''' week''''' underscore '''''name'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:39&lt;br /&gt;
| '''Strings''' can be '''sliced''' into '''substrings'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|02:43&lt;br /&gt;
|To get the first three characters of the string '''s''', type, '''s '''''inside square brackets '''''0 '''''colon '''''3'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:52&lt;br /&gt;
| As you can see, the character at last index ie '''3''' is not included in the sliced output.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:00&lt;br /&gt;
| We will check if the '''substring '''of''' s '''is present in the '''list''' '''week''''' underscore '''''name.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:06&lt;br /&gt;
| Type '''s '''''inside square brackets '''''0 '''''colon '''''3 in week''''' underscore '''''name'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:14&lt;br /&gt;
| We get the output as '''True''' which indicates that the substring is present in the list.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:20&lt;br /&gt;
| Pause the video. Try this exercise and then resume the video.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:26&lt;br /&gt;
| Obtain the '''substring''' excluding the first and last characters from the '''string''' '''s'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:32&lt;br /&gt;
| Switch back to '''terminal''' for the solution.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:36&lt;br /&gt;
| Type, '''s '''''inside square brackets '''''1 '''''colon '''''-1'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:42&lt;br /&gt;
| As we already know, the last element of the '''string''' can be accessed using the index''' -1'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:49&lt;br /&gt;
| Next let us learn to check if a given '''string''' is a '''palindrome''' or not. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:55&lt;br /&gt;
| A '''palindromic string''' is a '''string''' that is same as its reverse. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:01&lt;br /&gt;
| Type, '''s1 '''''is equal to inside double quotes''''' dad'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:07&lt;br /&gt;
| Now, we need to compare this '''string''' with its reverse.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:11&lt;br /&gt;
| For reversing '''s1''', we '''stride''' the '''string''' from the first to last '''character.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:17&lt;br /&gt;
| It is done''' '''by keeping the '''start''' and '''stop''' values as empty and '''step''' as -1.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:24&lt;br /&gt;
| That is '''s1 '''''inside square brackets colon colon''''' -1'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:30&lt;br /&gt;
| Now, we will check if the string '''s1''' is a '''palindrome''' or not.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:35&lt;br /&gt;
| Type, '''s1''''' is double equal to''''' s1 '''''inside square brackets colon colon '''''-1'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:44&lt;br /&gt;
| The output '''True '''indicates that it is a '''palindrome'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:49&lt;br /&gt;
| If the given '''string''' has capital '''D '''in''' dad''' instead of small '''d''', the comparison would return '''False'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:57&lt;br /&gt;
| So, we have to convert the '''string''' to all '''lowercase''' or '''uppercase''', before comparison. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:04&lt;br /&gt;
| '''Python''' provides the '''string''' '''methods''' '''lower''' and '''upper''' to achieve this.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:10&lt;br /&gt;
| Let's try it out. Type, '''s2 '''''is equal to inside double quotes''''' '''capital''' D ad'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:19&lt;br /&gt;
| Type '''s2.upper '''open and close parentheses We get all the '''characters''' in '''uppercase'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:29&lt;br /&gt;
| Type '''s2''' As you can see, '''s2''' has not changed. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:36&lt;br /&gt;
| It is because, '''method upper''' returns a new '''string'''. It doesn't change the original '''string'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:43&lt;br /&gt;
| Let us compare the original and reversed '''string''' in '''lowercase.'''&lt;br /&gt;
&lt;br /&gt;
Type as shown. As expected the output is '''True'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:56&lt;br /&gt;
| Pause the video. Try this exercise and then resume the video.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:02&lt;br /&gt;
| Check if each '''element''' in the following '''list '''is present in the '''list''' '''week''''' underscore '''''name'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:09&lt;br /&gt;
| Switch back to '''terminal''' for the solution.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:13&lt;br /&gt;
| Type as shown. It returns '''False''' for '''python '''as it is not there in the '''list week''''' underscore '''''name.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:24&lt;br /&gt;
| Next let us learn to use '''replace method'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:28&lt;br /&gt;
| Type, '''email '''''is equal to inside double quotes '''''info[at]fossee[dot]in'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:36&lt;br /&gt;
| We often encounter '''email addresses''' which have '''@''' '''symbol '''and '''periods''' replaced with text as shown. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:44&lt;br /&gt;
| Let us learn how to get back proper '''email''' '''addresses'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|06:49&lt;br /&gt;
| Now, we will first replace the '''[at]''' with the '''@ symbol''', using the '''replace method'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:55&lt;br /&gt;
| Type as shown. You can see that the '''@ symbol '''is properly replaced now.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:05&lt;br /&gt;
| Pause the video. Try this exercise and then resume the video.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:11&lt;br /&gt;
| Replace the '''[dot] '''with ''''.'''' symbol in the given '''email.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:16&lt;br /&gt;
| Switch back to '''terminal''' for the solution.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:20&lt;br /&gt;
| Type as shown.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:24&lt;br /&gt;
| Now the variable '''email''''' underscore '''''proper''' has the '''email '''in the proper form.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:30&lt;br /&gt;
| Next, we will look at another interesting problem.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:34&lt;br /&gt;
| Let us say, we have a list of '''email addresses''' in the variable '''email''''' underscore '''''list''' as shown.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:41&lt;br /&gt;
| We will obtain one long '''string''' of '''email addresses,''' separated by '''commas''' or '''semicolons'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|07:48&lt;br /&gt;
| We will use the '''string method join '''for joining the '''list items '''into a single '''string.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:55&lt;br /&gt;
| Type as shown. '''Comma''' followed by a '''space''' will give the '''string''' with the same '''formatting'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:04&lt;br /&gt;
| Type, '''print '''''inside parentheses''''' email''''' underscore '''''str''' You can see that all the email addresses joined into a single '''string'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:16&lt;br /&gt;
| Pause the video. Try this exercise and then resume the video.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:22&lt;br /&gt;
| From the '''email''''' underscore '''''str''', change the separator to '''semicolon''' instead of '''comma'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:29&lt;br /&gt;
| Switch back to '''terminal''' for the solution.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:33&lt;br /&gt;
|Type as shown. We see that the email addresses are joined by a semicolon followed by a space.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:43&lt;br /&gt;
| This brings us to the end of this tutorial. Let us summarize.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|08:49&lt;br /&gt;
|In this tutorial, we have learnt to, &lt;br /&gt;
&lt;br /&gt;
Obtain '''substrings'''&lt;br /&gt;
&lt;br /&gt;
Reverse '''strings''' by using the index numbers&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:58&lt;br /&gt;
|Use the following methods&lt;br /&gt;
&lt;br /&gt;
'''upper()'''&lt;br /&gt;
&lt;br /&gt;
'''lower()'''&lt;br /&gt;
&lt;br /&gt;
'''replace() '''and&lt;br /&gt;
&lt;br /&gt;
'''join()'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 09:05&lt;br /&gt;
| Here are some self assessment questions for you to solve&lt;br /&gt;
&lt;br /&gt;
1. Given a string '''s = &amp;quot;this was a string”''', how will you change it to &amp;quot;'''this wasn't a list'''&amp;quot;? &lt;br /&gt;
&lt;br /&gt;
2. The string '''s''' is assigned as shown, change the string to &amp;quot;'''friends'''&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 09:25&lt;br /&gt;
| And the answers,&lt;br /&gt;
&lt;br /&gt;
1. We will use the '''replace''' '''method''' to accomplish this.&lt;br /&gt;
&lt;br /&gt;
Here '''string''' and '''was''' in the statement will be replaced by '''list''' and '''wasn't '''respectively.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 09:39&lt;br /&gt;
| 2. In order to remove dots and to get '''substring '''we '''stride '''the '''string s'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 09:45&lt;br /&gt;
| To change the '''string''' to '''lowercase''', we use the '''string method lower().'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 09:51&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 09:55&lt;br /&gt;
| Please post your general queries on Python in this forum.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 10:00&lt;br /&gt;
| FOSSEE team coordinates the TBC project. (16.45)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 10:04&lt;br /&gt;
| Spoken Tutorial Project is funded by NMEICT, MHRD, Govt. of India. For more details, visit this website.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 10:14&lt;br /&gt;
| This is Priya from IIT Bombay signing off. Thanks for joining.&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Pratik kamble</name></author>	</entry>

	</feed>