Input function the input function allows to take input from the user.
And this is the syntax for the input function.
So let's call the input function.
I have called the input function and when I executed I have a box here that is displayed in the output.
So because the input function is used to take input from the user.
So let enter Some text here.
I'm gonna see how are you.
And then hit enter the interpreter has displayed what ever text I have entered in the squared box that
was displayed here.
Python has taken the line that I have entered and then printed what ever line it got.
But it is not obvious what is going on here.
So let's do one thing.
Let's assign the input function to a variable and then execute this in.
So I have a squared box again just below the Input cell.
So I'm now going to end it.
How are you and then hit enter now.
Let's display a So the variable E has been assigned the text whatever was input from the keyboard but
in real life the user has to know what a program is asking him or her to enter.
Let's say I'm going to assign the input function to a variable just like we did before.
I'm going to enter this text.
How old did you then execute the cell.
As you can see the text that we have passed as a parameter to the input function is reproduced in front
of the place we type.
And this is called a prompt because it promises to enter something I am hundred and then hit enter.
And now let's display the variable.
So a is a string as you can see it is the number hundred is enclosed in quotes.
Let check the type of the variable a it is a string.
The input function.
Convert.
What about the user has entered into a string so that is the reason the variable e is of the data type
string.
Now if you want to convert into another data type say for example I want to convert the input from the
user into an integer.
I'm gonna pass this message How old are you.
So this will be displayed to the user and I want to convert the message that the user has entered into
an integer.
I'm going to parse the input function as a parameter to the integer function I N D.
So let's execute this.
So I'm gonna say hundred into and then display a it's hundred.
Now check the type of a it's an integer now.
So when the input function is called the program flow will be stored until the user has given an input
and has ended the input with D in case of the Jupiter notebook.
When the user hits the shift and enter keys the text that we have endured here for the input function
is optional.
And the text that we enter here will be reproduced in front of the place we type.
But just call a prompt because it prompts us to enter something.
And this brings us to the end of this tutorial on built in functions.