Hello, everyone.
Now you have the knowledge of basic input, output and mathematical operations.
So let's test your knowledge using these very simple questions.
You can pause your screen and try these questions and follow.
I will be explaining the questions after that.
So I hope you have solved these questions.
Now, let me explain these solutions for these one by one.
So the first question is the two numbers as input and print, the result as below.
So first, we'll see how we can take inputs and then print those.
So what?
Digging in, what you can take and put in any way see X
and we say input and insight, input.
We can give any message so that according to the message, the person can give us input.
So we will say, please enter the first number.
And similarly, we will get this number one.
Now, let's also check the class and the data type of X and Y in Boston, you can run using print defects
also and simply type also.
The board will give you similar results.
So let me run this.
So let's say 24.
And so it tells me that the type of string.
But we are expecting numbers.
So this means we need to type these.
So we will simply say int or float.
So let me see it for now.
So I'm assuming that these are individuals.
So I'm digging into you can dig float also or let me take it as sort of set.
And then run this code.
See, now the glassful, both X and Y is flawed.
So now these will be treated as numbers.
Now we can simply find out the sum difference right after the two numbers so we can easily do that.
So we'll simply say print and in the print statement, we can likely get the result.
You can write different statements or something like X plus Y, and then you give a comma so that you
can write string and numbers simultaneously.
And you can see X plus Y.
So you can see you get the results.
Similarly, you can do the same thing for Dufresne's.
Product.
Result of endangered division, so integer division is named this.
Let's see.
So this is the integer division.
This is the product of these numbers.
This is the difference.
This is the sun.
And you can see all the results are coming in flawed because the other day that I have which we have
given is floated.
If you wanted this to be an integer, you could have simply given the type as a leader, and then it
would have dealt with these numbers as integers.
You can practice that also.
You can try different variants.
What happens if X is in Ægir rise fluid?
What happens when water flows?
What happens when both had integer?
So you can try all these things.
Next is the result of flawed division, so let's also get that very quickly.
This is the floor division now you see we have Banner Integer Division.
That is why we are getting one here.
Whatever the remainder is, it is getting completely ignored while here.
These are coming in a float number.
Then we have the Montello, but we don't know what Madeley operator does is it gives you the remainder.
So let's do that as well.
And let's get this so you can see 22 divided by 12.
It gives us Dayna's remainder as expected.
Now, next is the result of Bellmont.
Now let's see what actually the more does.
We are not aware of that is my function.
So it is a good information for us.
So let's see what more does.
Now, you can see it is giving us that this morning is not a flawed operation.
So this means that there is something which is wrong here.
So let's understand how we can look at the documentation of different functions.
So to see the documentation, you can simply say help and insight help.
You can push and give more whatever function you want to need help on.
So here you see the Morente X, X and Y as input, and then it returns to values to us.
So we will get the results out of work.
One is the divisor and the other one is the remainder.
So you get the both the values which you would have got from these two operations separately.
So the desire to have these two operations, I will be getting them separately when I use the word function.
Now, it is very useful to use this help operation because it allows us to see all the documentation.
So you need not remember everything every time.
So whenever you are facing some kind of problem or you forget how the function works, you can simply
use help there.
So we removed this and took X here and done this.
So you can see the result.
So you get one here and then here, as expected.
Now let's see if we can find the result of this particular function using Mad, not Fabel EBC.
Now, what is this?
Let's see these two operations separately.
So for this, we will actually need three numbers.
So let's input another number or let me just simply
create a number here.
So it needs A, B and C. All three.
So I simply say in the form of the pharmacy is equal to see to form a four comma.
So what this operation does here is it will assign two to a four to be five.
To see this particular operation is as good as saying E is equal to to be equal to four and C equal
to five.
So you can either write it this way or write in this way, this one and the same thing.
This is simple in nature.
It's not taking too many lines also.
So that is why we prefer that.
But it's just completely up to you, which some Dexy.
Wonderful.
Now let's have a look at this and let's bring the results of.
And we will also bring the results for this one as well.
Let's see what is the difference between all of this.
OK, so we need the math also.
So math is a package or a library.
You can say, well, we can find many more functions related to mathematics.
So let's import facts.
So this is how you import a library and then you can use the functions of that library or different
attributes associated with that library.
By simply using this dot operator, you simply write the library name, dot the function you want to
use from it.
So I just run this.
And here Bao is expecting two arguments.
Well, got three.
So let us see how this works.
Again, we will put it into.
Help.
So it takes.
So we need to input base.
And it needs the exponential value to what power we want to take it to.
So here you can see this is one.
How did we get it?
We got it from Italy.
And then we are trying to find the remainder of it.
Right.
So similarly, let's say Italy, Barbie.
And then after that, we can simply get the remainder of it using this.
This is the design.
We did the same thing using two different operators.
We can use the double star for the finding of the father.
And also we can use my daughter Bella for the same operation.
You can do it both ways.
Next is rounding up a number to the nearest 20 thousand and the next multiple of this particular number.
So these are two different things which we want to achieve now.
One important thing is that when you want to try and round up a number, you can simply do that to a
particular number of digits.
So it is simple when you want to do it for a particular number of digits.
So let's have a look at the round function.
See, so that function gives us.
It simply takes the number and it takes the number of digits you want to round the number do.
So let's try this out.
So we see a round and we give let's see, one, five, six, seven, some.
What particular number?
Let's do it this way.
And we say let's save two.
Let's see what happens.
It doesn't do anything because here there are two numbers.
Let's make it four.
Now, what is happening?
Nothing is happening here.
So there is some problem with the direction.
So let's put it out here and make it a floating point number.
So I say two, three, four, five, six.
I think a lot of numbers in front of it.
Now let's do it as one.
So it rounds it up to one decimal point.
The next Big Three, it will rounded up to three decimal points.
Now let's put minus three here in stack.
So when we say minus three, it rounds up in the other direction.
So we do not want to do it in a positive direction, but we want to do it in the negative direction.
So we don't want to round up the best moves, but we actually want to round up the numbers.
OK, so we want to rounded to the nearest 20000.
So let's make it minus four.
Well, that is something which we did not want.
What is happening here is we have sixty seven hundred.
So the nearest 20000 will be one five two oh one five.
Twenty thousand.
So this is thousand, so this is fifty six thousand, so the nearest twenty thousand would be one six
seven zero.
So let's complicate this number a little bit.
Let's use some other numbers.
So let's take it one by one, maybe.
So this number.
Let's take another number.
Let's pick three numbers here.
So the nearest 20 thousand to eighty one thousand will be 80000, the nearest 20000 to eighty nine thousand
will be again 80000.
The nearest 20000 to ninety one thousand will be one leg.
So that is what we are expecting.
So let's put it here first.
It gives eighty thousand when we let's print all of these.
So here you can see it is a rounding to the next or the nearest ten thousand right now.
So for eighty one thousand, it is rounding to eighty thousand for eighty nine thousand nine hundred
resounding to ninety thousand four ninety one thousand.
It is rounding to 90000.
So this is not rounding to the nearest twenty thousand.
Back to the nearest ten thousand.
But we are looking for the nearest twenty thousand.
So let's get for them now.
Let's divide this particular number with twenty thousand.
So let me create another reading.
Everything is equal to twenty thousand.
And look, we divided with all these numbers, so I will simply divide it.
Baby,
and let's get rid of this.
What do we have?
We have four, four, five.
And let's multiply it with the again.
So here you get what we were looking for.
Now, what we have simply done is because we wanted to find out what nearest multiple of 20000 it was.
So we had to divide it by twenty thousand and then round the number and then multiplied with 20000 so
that we could get a multiple of 20000 then.
So this is how you find the multiples or you can see the nearest rounding for our particular numbers
multiply.
Now, let's see.
I want to do this.
With the next one.
So here we are just rounding to the nearest twenty thousand.
But let's say we want to noetic to the next multiple of twenty thousand.
So in this particular case, the next multiple of twenty thousand four, eighty one thousand will be
one like four eighty nine thousand.
It will again be one lap for ninety one thousand and will again be one left.
So these two values are wrong for now.
So let's get this
now.
We want to round these numbers, but we want to round these numbers so that the decimal goes to the
next number.
We want to get the next upward value offered.
So we simply find the stealing of the number instead of rounding up the number.
What the ceiling give ceiling gives the output value.
So we see.
And scroll through down.
Now, again, SEAL is a function of math library, so we will have to see my daughter.
Now, let's get this.
So here you get the results accordingly.
So this was a pretty simple exercise, and it will take you through different mathematical operations,
which you can come across in future.
So it is fine if you faced a problem in solving some of the questions you will learn through the time
once you keep on practicing.
So let's go ahead with the next topic.
Thank you.