<?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%2FInput-output%2FEnglish-timed</id>
		<title>Python-3.4.3/C3/Input-output/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%2FInput-output%2FEnglish-timed"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python-3.4.3/C3/Input-output/English-timed&amp;action=history"/>
		<updated>2026-05-13T11:56:48Z</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/Input-output/English-timed&amp;diff=47675&amp;oldid=prev</id>
		<title>Pratik kamble: Created page with &quot;{| border = 1 | '''Time''' | '''Narration'''  |- | 00:01 | Welcome to the spoken tutorial on '''Input and Output'''.   |- | 00:06 |In this tutorial, we will learn to   '''Prin...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python-3.4.3/C3/Input-output/English-timed&amp;diff=47675&amp;oldid=prev"/>
				<updated>2019-06-04T09:15: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;Input and Output&amp;#039;&amp;#039;&amp;#039;.   |- | 00:06 |In this tutorial, we will learn to   &amp;#039;&amp;#039;&amp;#039;Prin...&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 '''Input and Output'''. &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;
'''Print''' some values&lt;br /&gt;
&lt;br /&gt;
'''Print''' using '''format specifiers''' &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|00:14&lt;br /&gt;
|Take '''input''' from user and&lt;br /&gt;
&lt;br /&gt;
Display a '''prompt''' to the user before taking the '''input'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|00:22&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:38&lt;br /&gt;
| To practise this tutorial,  You should know how to run basic '''Python '''commands on the '''ipython console.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 00:47&lt;br /&gt;
|If not, see the relevant '''Python '''tutorials on this website.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 00:52&lt;br /&gt;
| Let us start '''ipython'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 00:55&lt;br /&gt;
|Open the '''terminal.''' &lt;br /&gt;
&lt;br /&gt;
Type '''ipython3 '''and press '''Enter.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:03&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:10&lt;br /&gt;
| Let us start this tutorial with a '''string.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:14&lt;br /&gt;
|Type, '''a '''''is equal to inside double quotes''''' This is a string'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:21&lt;br /&gt;
| To see the value of '''a''', type, '''a'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:26&lt;br /&gt;
| Type, '''print''' ''inside parentheses'' '''a''' &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:31&lt;br /&gt;
|This also prints the value of '''a'''. But there is a difference in the outputs. Typing just''' a '''displays the content of '''a. '''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:43&lt;br /&gt;
|The '''statement print''' ''inside parentheses'' '''a''' prints the '''string''' itself. We can see the difference clearly when we use '''strings''' with new lines in them.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 01:55&lt;br /&gt;
|  Type '''b '''''is equal to inside double quotes''''' A line backslash n New line'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:04&lt;br /&gt;
| Type, '''b''' As you can see, it just shows that '''b''' contains a '''newline character'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:13&lt;br /&gt;
| Type, '''print '''''inside parentheses '''''b'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:18&lt;br /&gt;
|It prints the '''string, A line''' and then '''New line''' in the next line. '''print statement''' in '''Python''' supports '''string formatting'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:28&lt;br /&gt;
| Next we shall look at different ways of outputting the data.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:33&lt;br /&gt;
|'''Percentage string operator''' is called as '''format operator'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:38&lt;br /&gt;
|For example:&lt;br /&gt;
&lt;br /&gt;
'''Percentage d''' - specifies the '''integer format'''&lt;br /&gt;
'''Percentage s''' - specifies the '''string format''' and&lt;br /&gt;
'''Percentage f''' - denotes the '''float format'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 02:52&lt;br /&gt;
| Switch back to the '''terminal'''. Next let us assign x as shown.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:00&lt;br /&gt;
|To print the value of '''x''', type as shown.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:06&lt;br /&gt;
|Here '''''percentage'' 3.2f''' specifies the output in '''float''' and '''.2f''' rounds off the value to two decimal point.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:18&lt;br /&gt;
| We will see one more example. Type as shown. Here, it rounds off to four decimal places.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:30&lt;br /&gt;
| Next, let us assign two more values. Type, '''y '''''is equal to''''' 2'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:38&lt;br /&gt;
| '''z '''''is equal to inside double quotes '''''red'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:43&lt;br /&gt;
| To print the value of '''x, y''' and '''z''', type as shown.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:50&lt;br /&gt;
|Various '''arguments''' can be passed to '''print''' using '''modifiers'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 03:55&lt;br /&gt;
|The values of x, y and z are substituted in place of the '''format specifiers''' as&lt;br /&gt;
&lt;br /&gt;
'''percentage 2.1f, '''&lt;br /&gt;
'''percentage d '''and&lt;br /&gt;
'''percentage s''' respectively. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:09&lt;br /&gt;
| Pause the video. Try this exercise and then resume the video.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:15&lt;br /&gt;
|What happens when you execute the following?&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:18&lt;br /&gt;
| Switch to the '''terminal''' for the solution.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:22&lt;br /&gt;
| Type as shown. Here the '''int''' value of '''x''' and '''float''' value of '''y''' are printed as per the '''format specifiers'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:34&lt;br /&gt;
|It prints six decimal places by default for '''float'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:39&lt;br /&gt;
| Usually '''print statement''' prints the output in a new line. Now we will see how to suppress the '''newline''' character.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:49&lt;br /&gt;
|Open a text editor and type the following code.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 04:53&lt;br /&gt;
| The newline character can be suppressed by passing '''end '''''is equal to inside single quotes''''' '''a''' space'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:01&lt;br /&gt;
| Save the script as '''print''''' underscore '''''example.py.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:07&lt;br /&gt;
| Switch back to the '''terminal'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:10&lt;br /&gt;
| Let us run the code by typing '''percentage run '''space''' print '''''underscore''''' example.py '''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:19&lt;br /&gt;
|We can see that the '''print statement''' prints a '''space''' instead of a new line.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:25&lt;br /&gt;
| Next we shall look at taking input from the user. We will use the '''input function''' for this. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:33&lt;br /&gt;
|Type '''ip '''''is equal to '''''input''''' open and close parentheses ''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:39&lt;br /&gt;
| The '''cursor''' is blinking indicating that it is waiting for an '''input'''. Type, '''an input''' and press '''Enter'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 05:49&lt;br /&gt;
| Now let us see what is the value of '''ip'''.Type '''ip''' We can see that it contains the '''string - an input'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:00&lt;br /&gt;
| Pause the video. Try this exercise and then resume the video. Enter the number 5.6 as '''input''' and store it in a variable '''c'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:12&lt;br /&gt;
| Switch back to the '''terminal''' for the solution.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:16&lt;br /&gt;
| We have to use the '''input''' command with variable '''c'''.  Type, '''c '''''is equal to''''' input '''''open and close parentheses''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:26&lt;br /&gt;
| Enter 5.6 as '''input'''. Press '''Enter'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:32&lt;br /&gt;
| To see the input value, type''' c'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:36&lt;br /&gt;
| Now let us see the '''data type''' of '''c'''. Type, '''type '''''inside parentheses '''''c''' We see that '''c''' is a '''string'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:48&lt;br /&gt;
|Because '''input''' command always takes the '''input''' as '''string''' no matter whatever is the '''input'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 06:56&lt;br /&gt;
| Pause the video. Try this exercise and then resume the video.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:02&lt;br /&gt;
|Execute the below '''statement'''. What happens when you do not enter anything and hit '''Enter'''?&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:10&lt;br /&gt;
| Switch back to the '''terminal''' for the solution. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:14&lt;br /&gt;
| Type '''d '''''is equal to''''' input '''''open and close parentheses'' Press '''Enter''' without giving any '''input'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:24&lt;br /&gt;
|Again press '''Enter''' to get the '''prompt'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:28&lt;br /&gt;
| To see the '''input''' value, type, '''d''' When nothing is entered, an empty '''string''' is considered as '''input'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:38&lt;br /&gt;
| We can also use '''input '''to display a '''prompt''' to assist the user. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:44&lt;br /&gt;
|Now we will give a '''prompt''' to get the '''input'''.&lt;br /&gt;
Type '''ip '''''is equal to''''' input '''''inside parentheses inside double quotes '''''Please enter a number '''''backslash''''' n'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 07:58&lt;br /&gt;
| I will give 12 as '''input'''. This is how we can display a '''prompt''' to get '''input''' from user.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:08&lt;br /&gt;
| This brings us to the end of this tutorial.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:12&lt;br /&gt;
|Let us summarise. In this tutorial, we have learnt to,&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:17&lt;br /&gt;
| Use '''print statement'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:20&lt;br /&gt;
| Use the '''format specifiers ''percentage ''d, ''percentage ''f '''and''' ''percentage ''s''' in the '''print statement '''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:29&lt;br /&gt;
| Take '''input''' from user by using''' input function''' and  Display a '''prompt''' to the user before taking the '''input'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:39&lt;br /&gt;
| Here are some self assessment questions for you to solve '''a ''is equal to'' input ''open and close parentheses''''' and user enters '''2.5'''. What is the '''type''' of '''a'''? &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 08:55&lt;br /&gt;
|2. If '''a ''is equal to'' 2 '''and '''b ''is equal to'' 4.5''', what is the result of the following action? &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 09:05&lt;br /&gt;
| And the answers,&lt;br /&gt;
&lt;br /&gt;
1. No matter what you enter, it will be taken as a '''string'''. Hence '''2.5''' is a '''string'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|09:16&lt;br /&gt;
|2. Since '''b''' is called first, it will display '''integer''' value of '''b.''' Because the '''modifier''' used is''''' percentage ''d'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 09:28&lt;br /&gt;
|Similarly, '''float''' value of '''a''' will be displayed due to its '''modifier ''percentage ''2.1f'''. Hence the output is''' a is 4''' and '''b is 2.0'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 09:42&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 09:46&lt;br /&gt;
| Please post your general queries on Python in this forum.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 09:51&lt;br /&gt;
| FOSSEE team coordinates the TBC project.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 09:55&lt;br /&gt;
| Spoken-tutorial is funded by NMEICT, MHRD, Govt. of India. For more details, visit this website.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 10:04&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>Pratik kamble</name></author>	</entry>

	</feed>