Hello again let's now have a look at how we can take an input from the user and tell the user to input
something to give me back something and then and then as a result I would get some I would get something
in such a way that I could operate on the same right.
So let's take an input from the user navigating an input from the user.
We need to use a built in function which we will just have a look at.
So let's go back to the documentation how will we go.
We can go from here itself and the help we can get to Python docs but when we open inviting docs from
here it will open up in the in the browser which is on the Raspberry Pi.
And because it the Raspberry Pi it can take a lot of processing whenever you open a browser and if you
do not want to do that and you open a browser on the Raspberry Pi and if you're doing it on a computer
if you have open the screen of the Raspberry Pi on your VNC OK.
For now I'm just bringing it out.
I'm coming back into the Windows environment outside and after coming here I just need to check with
the documentation so I will go here and I will just see right there the documentation for for.
So Khaitan docs are quite in docs and then I'll get that.
So three points explain for documentation the Library Reference the built in functions and in the bill
that functions.
Let's have a look at a function that can help us out.
Let's say the function that can help us out in taking an input from the user is going to be the input
itself.
OK so let's take an input from the user and anti-graft from the user Solange's full screen.
Also if file new fire OK I'm going to take an input from the user now input function input.
Now what does input function require.
As a parent or what does this command requires a part of.
Let's have a look once again exit and come here.
Click on input or input click on input requires an optional bottom Eido the paramita that is there.
What is the meaning of prompt.
Which means you can give a prompt.
Or you can ask something or it can tell something the user to enter.
So that means I can say here enter number.
I can tell it as a string.
Now when you tell this to when you tell this to him this input function is going to execute it and then
put function is now going to wait for the user to enter something.
Now comes onto the user and does something.
The input function will not mind my words without the user entering something the input function will
not leave this particular execution line which means the execution will not go forward.
This input function will block the code out there.
Wait for the user input when the user input.
Then it will go ahead.
So now when the user gives you an input you need to store it somewhere.
You need to store it in something called as a variable.
So let's start adding a variable that say some and let's do some.
The minute the user enters something I have stored that in whatever the user has entered.
All I need to do is I need to print.
Let's say that numb multiplied or oh you multiplied.
By let's say 10.
So if I enter 5 The answer should be ideally what 50 should be.
Should be 50.
Let's see if that is the answer.
Save let's say save it as inputs use a call.
Now I'll run this function of five it saves engine number.
All right I'll enter a number let's say five.
Ideally Unza should be 50.
But what's the answer.
5 5 5 5 5 5.
How many times five.
One two three four five six seven eight nine 10 oh printed five ten times.
But I called you were.
But I thought it was a number.
Let's see.
No it's not a number because if I ever put it in that type Wolf number of the number that I've gotten
that use to see that type what that type of number got the user function f 5 once again.
What is the number that I got from the user or type of.
It's a string.
So that means whatever the user enters the input function takes it as a takes it as a string.
So whatever the user enters the input function takes it a string which is not which which then that
string gets multiplied ten times.
That means that string was five it got printed 10 times.
OK so maybe you do not know this but if there is a string which is let's say hi and if that string is
multiplied 20 times it will print hi 20 times.
OK that means.
So basically that's the same thing what's happening when you multiply the string 10 times.
It just printed 10 times.
OK.
But when I thought this was the number.
No there's not a number.
This is a string all.
So what should I do.
Which means whatever the user inputs whatever the user inputs I need to convert it.
So whatever the user inputs that means the input function is going to return to me a string and died
and would return to me a string.
Now whatever the user gives me or whatever the user gives me that is stored in a string when I get an
input.
But then I need to before storing it and I need to convert that into when responding in the future I
need to convert it into an integer because I know that fiber is going to be a number.
I know that the user has to enter an number what should I.
Relate to.
I will then again go back to that documentation and check if there is a built in function which can
convert a string to an individual.
There is there is a built in function calls in.
And what does it do.
It returns in Peter object constructed from a number or a string of X or its returns zero if not humans
are given.
All right.
So I need to create a number I need to create whatever is input from the user.
That should be considered when in danger by putting the entire operation into.
And in the bios so that whatever is input from the user is muddle into any teacher and then shouldn't
do.
Well now if I type in the type of number and if I print the number multiplied by 10.
Let's see is the answer.
There are number five type of numbers class and.
So there's 50 Zappia.
So you have five tens or 50.
So this is about an integer is about taking an input from the from the user.
All right.
So you take an input from the user and then do a particular approach.
Now if you want you could have done something like this for a previous file that we had already done
let's say operators instead of saying is equal to 7 and B is equal to 3 You could have told you could
have told the user to enter it.
You could have said is equal to input and of value for me.
OK.
And because this input will take it as a string I should convert it into n in Dejah.
Correct.
And then I should have another value which is entered a value for B
correct than what it is stored in B and then it should be in the NBA and it should.
And it should be in the plus and minus B is a multiplier would be.
And so one save.
And if I run this interval for a let's say let's say 45 and up and a rally for B save Phife enter call.
So you have a plus 50 minus 40 multiply babies to 25.
Well baby's nine point zero a blah blah.
Yeah.
So you have quite a lot of things to do when you take an input from the user.
All right let's get back into the mode.
OK so this is how you take an input from the user and you will do a particular operation.
So we saw that with the medical practice player.
All right in the next video we go on to something called a selection statement or let's see how to how
to make a statement or select or make a decision when we have to clear.