Biton input, output and input, we know that each and every programming language, we are supposed
to have some input statements to take data from the environment, from the keyboard, from the users
who are interacting with the application.
And we should produce some output of the processing, the input.
We should produce some output in some representable form.
So how to get this input from the keyboard and produce output for the visualization to the users in
Python?
We are going to discuss that one in our respective video.
So what about input?
Sometimes we believe on the usability of our programming code.
We shall divide our program, a large program into smaller models, and those models will be used by
the other python codes by importing those models in their respective Cordier.
So let us go for that discussion.
So some of the functions, like our input, function and brain functions, are widely used for standard
input and output operations respectively.
When our program goes big bigger, it is a good idea to break it into different models for the easy
understanding, for the easy debugging and for for the easy handling of our code for the user program.
Development definitions inside the model can be imported to another model or the interactive interpreter
in Python, and we use the input keyword to import that external model to the current code.
So to have a better idea, let us go for one practical demonstration.
Very shall be showing you that how to take inputs, how to put the outputs on the screen, and how we
are going to import our models in our current code.
So here is a demonstration for you.
We're going to discuss the print function and its usage to print a sentence or to print a variable value
on the screen.
We use the method print, so print this sentence is output to that screen here.
So if you go for the execution, you can find that this sentence is output to the screen is equal to
five.
And here you are writing the value up is equal to eight.
So now this five has got printed.
And if you go for this print, one, two, three, four.
So print is producing the outcome as one, two, three, four in this way.
Now see, if I go on writing this one as e this added value up is.
Plus it will produce one error message because it is the type of integer, it is not a string.
So it can be done in this way.
That is it.
Is that because we are converting this to the string type and then we are going to print that one as
this.
So that is not the way to print the same address.
The simple syntax is this one.
These are simple Syntex, you can find that this print and this print, they are coming and the outcome
is coming into two separate rooms.
But if I want to print this one in the same room in which it got printed, in that case, I shall be
right here is equal to and is equal to this.
That means the string, which is having one default slash in that is a new line character as that as
the trailing new character by default.
So I'm just replacing that one using null.
So now what will happen?
These two lines will get printed in the same room.
So now if I put this one has this so you can find that the outcome is coming, something like this one
address, if you don't mention in the end here, then they'll get printed in separate lines.
Not one, two report anticipated here it is, star, so print one, two, three, four, separated.
Here he starts to print as one starts to start.
Three Starford and this way.
So here you have given the and if you give the separated as comma, if you give the separated us comite,
you see that they get separated by this comma and blank spaces.
If it is so, so they'll get separated in this way.
So separated is actually indicating that will the what character you are supposed to get within the
within the variables are the values.
When you get printed using the print statement here you are having this hash as a separate at an end
with this ampersand.
So they had this hash, as we saw before, that this is a separate and this ampersand is coming as the
respective end one.
So that's why it is getting printed in this we.
Next one I love, this is my placeholder, and the placeholder number is zero and the placeholder number
is one who had this braid will be the will be at the zero place, will be replacing the zero placeholder
and his partner will be replaced as that one placeholder.
So we can find that it is coming.
It is producing the output, something like this.
So I love one.
I love one and zero.
So here we are having the same.
So I love butter and bread.
In this way it is by default it will be taking this one need not to mention any kind of placeholder
here so we can find out what the strings are getting printed accordingly here to pass this bread at
first in butter.
So bread is coming down here and butter is coming down here.
So now here to see this is my bread.
So this bread, is that the Delaplane?
So it will be coming down here and butter, this is the first.
So if it is at the right place, it is at the index one.
So this year the butter will be coming here accordingly.
So you can find out how this respective placeholders and the respective values are getting related in
this way.
So we can get the idea that.
Without mentioning any placeholder number, if you can just mention them, the book, these two lines
will produce the same output as well.
Will these two lines will produce the same output.
But in this case, Red will be will be at the Ziliak Index here.
The placeholder GELO will be taken this spread and his partner is at the index number one.
So that's why it will be taking out a placeholder one.
It will be replacing the placeholder one.
So in this way, the outcome is getting different.
Next, how to take input from the keyboard in that case, we can we can use the input method, we can
use the input method here.
So using this input and as a prompt, we're having and using this input, we're getting the value from
the keyboard as input and that will be assigned to X and input returns the value in the terms of a string.
So let us go for this.
So I'm just putting this one one hundred.
So we can find that entertaining any number.
So this has come I put this one hundred subindex is printing this one as one hundred.
This is actually getting this one in in the time of the type of string.
So input returns string here.
So now we can go for this.
If we go for this, why if they want to convert it to this integer, I can do that one in the gives.
The typecasting is equal.
That is the method conversion method from string to digit be required here.
So I'm making this one is one hundred, I'm giving this one as two hundred, you can find that this
one hundred and two hundred will get printed.
I'm just repurposing it by white.
So one hundred is nothing but hair string, and this two hundred is nothing but here indigent because
we have done the typecasting accordingly using the method.
And so now if we go for the addition, if you go for the print, if you go for this white, then obviously
it will produce some error message because we are trying to do string plus integer.
So that is a tie, Peter, so I want to convert it, I should be converting this one to integer.
So now if I go for the addition, you can find that I'm getting here three hundred as is what others
if convert converted to the string, the other integer one.
If you convert it to the string, then algebraic additions will not take place.
But string concatenation will take this.
You see, the supreme on television has taken place, so in this way you can use the input function
to take the values from the input from the keyboard and default output argument for this input function
will be a string.
Next one, we are having this import, so import not similarly done at the top of the program.
So this math module we have imported and literally from the axis, this power supply means power so
mad that power we can access and that is able to do so in this way.
It will it will make this one as two.
But that is extra to in this case.
So if I make this X is equal to, say, 100 if I make this one.
So here I'm getting this one handed to the prop to that is that is of one thousand we're getting this
one is 10000.
So that is my math duckbill.
So this math is nothing but one model and the model will be imported by the, quote, import and later.
This method, which is defining this model map, can be accessed using that is a matter metadata power,
and this is my respective first argument.
It is a second argument and it is working as fast argument to the second argument.
So as a value up here it is one hundred.
So I'm getting the ten thousand as AZAPO and we can find that this power is returning a value of the
type of local supply.
Power is getting a value of the type of if we can obtain it, I'm getting hundred as outcome.
So here to discuss a lot on this print, on this input and also on this import export, watching this
video.