WEBVTT

00:01.080 --> 00:01.890
Hello, everyone.

00:02.190 --> 00:07.980
Now you have the knowledge of basic input, output and mathematical operations.

00:08.250 --> 00:12.960
So let's test your knowledge using these very simple questions.

00:13.620 --> 00:19.050
You can pause your screen and try these questions and follow.

00:19.080 --> 00:21.450
I will be explaining the questions after that.

00:34.960 --> 00:37.300
So I hope you have solved these questions.

00:37.600 --> 00:41.290
Now, let me explain these solutions for these one by one.

00:43.090 --> 00:49.060
So the first question is the two numbers as input and print, the result as below.

00:50.020 --> 00:55.600
So first, we'll see how we can take inputs and then print those.

00:56.080 --> 00:56.710
So what?

00:56.710 --> 01:00.280
Digging in, what you can take and put in any way see X

01:04.240 --> 01:09.070
and we say input and insight, input.

01:09.070 --> 01:13.840
We can give any message so that according to the message, the person can give us input.

01:14.170 --> 01:21.310
So we will say, please enter the first number.

01:23.230 --> 01:25.780
And similarly, we will get this number one.

01:43.750 --> 01:57.520
Now, let's also check the class and the data type of X and Y in Boston, you can run using print defects

01:57.520 --> 01:59.770
also and simply type also.

02:00.250 --> 02:02.230
The board will give you similar results.

02:02.650 --> 02:04.030
So let me run this.

02:06.160 --> 02:07.830
So let's say 24.

02:08.090 --> 02:12.460
And so it tells me that the type of string.

02:12.970 --> 02:14.980
But we are expecting numbers.

02:15.160 --> 02:17.740
So this means we need to type these.

02:17.980 --> 02:21.250
So we will simply say int or float.

02:21.670 --> 02:23.350
So let me see it for now.

02:25.780 --> 02:27.870
So I'm assuming that these are individuals.

02:27.880 --> 02:33.430
So I'm digging into you can dig float also or let me take it as sort of set.

02:41.360 --> 02:42.710
And then run this code.

02:47.330 --> 02:51.180
See, now the glassful, both X and Y is flawed.

02:51.230 --> 02:53.600
So now these will be treated as numbers.

02:55.820 --> 03:05.810
Now we can simply find out the sum difference right after the two numbers so we can easily do that.

03:06.350 --> 03:11.780
So we'll simply say print and in the print statement, we can likely get the result.

03:11.780 --> 03:21.800
You can write different statements or something like X plus Y, and then you give a comma so that you

03:21.800 --> 03:25.340
can write string and numbers simultaneously.

03:25.790 --> 03:28.970
And you can see X plus Y.

03:29.570 --> 03:31.520
So you can see you get the results.

03:33.230 --> 03:38.120
Similarly, you can do the same thing for Dufresne's.

03:44.610 --> 03:45.410
Product.

03:58.670 --> 04:05.780
Result of endangered division, so integer division is named this.

04:16.470 --> 04:17.810
Let's see.

04:20.820 --> 04:22.970
So this is the integer division.

04:23.040 --> 04:25.140
This is the product of these numbers.

04:25.380 --> 04:26.940
This is the difference.

04:27.390 --> 04:28.380
This is the sun.

04:28.680 --> 04:34.560
And you can see all the results are coming in flawed because the other day that I have which we have

04:34.560 --> 04:35.780
given is floated.

04:36.090 --> 04:42.450
If you wanted this to be an integer, you could have simply given the type as a leader, and then it

04:42.450 --> 04:45.390
would have dealt with these numbers as integers.

04:45.390 --> 04:46.760
You can practice that also.

04:46.770 --> 04:48.360
You can try different variants.

04:48.390 --> 04:51.330
What happens if X is in Ægir rise fluid?

04:51.340 --> 04:53.460
What happens when water flows?

04:53.790 --> 04:55.920
What happens when both had integer?

04:56.130 --> 04:57.750
So you can try all these things.

05:01.130 --> 05:07.730
Next is the result of flawed division, so let's also get that very quickly.

05:17.510 --> 05:22.180
This is the floor division now you see we have Banner Integer Division.

05:22.220 --> 05:24.930
That is why we are getting one here.

05:24.980 --> 05:29.630
Whatever the remainder is, it is getting completely ignored while here.

05:30.380 --> 05:33.530
These are coming in a float number.

05:33.980 --> 05:42.460
Then we have the Montello, but we don't know what Madeley operator does is it gives you the remainder.

05:42.470 --> 05:45.260
So let's do that as well.

05:49.810 --> 05:58.410
And let's get this so you can see 22 divided by 12.

06:01.210 --> 06:06.010
It gives us Dayna's remainder as expected.

06:06.430 --> 06:09.370
Now, next is the result of Bellmont.

06:09.400 --> 06:12.130
Now let's see what actually the more does.

06:12.460 --> 06:15.280
We are not aware of that is my function.

06:15.290 --> 06:19.420
So it is a good information for us.

06:19.600 --> 06:21.370
So let's see what more does.

06:37.210 --> 06:46.420
Now, you can see it is giving us that this morning is not a flawed operation.

06:46.990 --> 06:51.260
So this means that there is something which is wrong here.

06:52.510 --> 06:58.600
So let's understand how we can look at the documentation of different functions.

06:59.830 --> 07:05.700
So to see the documentation, you can simply say help and insight help.

07:05.710 --> 07:10.540
You can push and give more whatever function you want to need help on.

07:11.050 --> 07:20.650
So here you see the Morente X, X and Y as input, and then it returns to values to us.

07:20.890 --> 07:23.050
So we will get the results out of work.

07:23.290 --> 07:30.040
One is the divisor and the other one is the remainder.

07:30.040 --> 07:35.710
So you get the both the values which you would have got from these two operations separately.

07:36.040 --> 07:41.470
So the desire to have these two operations, I will be getting them separately when I use the word function.

07:41.800 --> 07:49.570
Now, it is very useful to use this help operation because it allows us to see all the documentation.

07:49.580 --> 07:52.330
So you need not remember everything every time.

07:52.540 --> 07:57.550
So whenever you are facing some kind of problem or you forget how the function works, you can simply

07:57.550 --> 07:58.540
use help there.

07:59.950 --> 08:05.170
So we removed this and took X here and done this.

08:05.470 --> 08:06.820
So you can see the result.

08:07.360 --> 08:13.120
So you get one here and then here, as expected.

08:21.750 --> 08:31.950
Now let's see if we can find the result of this particular function using Mad, not Fabel EBC.

08:32.250 --> 08:33.180
Now, what is this?

08:33.660 --> 08:37.740
Let's see these two operations separately.

08:38.010 --> 08:41.310
So for this, we will actually need three numbers.

08:41.610 --> 08:45.510
So let's input another number or let me just simply

08:48.450 --> 08:49.920
create a number here.

08:52.680 --> 08:55.080
So it needs A, B and C. All three.

08:55.500 --> 09:02.880
So I simply say in the form of the pharmacy is equal to see to form a four comma.

09:04.680 --> 09:12.280
So what this operation does here is it will assign two to a four to be five.

09:12.300 --> 09:23.610
To see this particular operation is as good as saying E is equal to to be equal to four and C equal

09:23.610 --> 09:24.090
to five.

09:25.200 --> 09:30.090
So you can either write it this way or write in this way, this one and the same thing.

09:30.840 --> 09:32.840
This is simple in nature.

09:32.850 --> 09:36.230
It's not taking too many lines also.

09:36.240 --> 09:38.140
So that is why we prefer that.

09:38.160 --> 09:40.920
But it's just completely up to you, which some Dexy.

09:40.920 --> 09:41.490
Wonderful.

09:44.020 --> 09:49.720
Now let's have a look at this and let's bring the results of.

09:54.030 --> 09:56.820
And we will also bring the results for this one as well.

10:00.390 --> 10:02.730
Let's see what is the difference between all of this.

10:03.900 --> 10:05.790
OK, so we need the math also.

10:05.790 --> 10:08.550
So math is a package or a library.

10:08.550 --> 10:13.740
You can say, well, we can find many more functions related to mathematics.

10:14.400 --> 10:16.920
So let's import facts.

10:21.690 --> 10:27.510
So this is how you import a library and then you can use the functions of that library or different

10:27.510 --> 10:29.580
attributes associated with that library.

10:29.580 --> 10:36.450
By simply using this dot operator, you simply write the library name, dot the function you want to

10:36.540 --> 10:37.410
use from it.

10:37.980 --> 10:39.450
So I just run this.

10:40.350 --> 10:45.200
And here Bao is expecting two arguments.

10:45.210 --> 10:46.440
Well, got three.

10:47.760 --> 10:49.950
So let us see how this works.

10:54.080 --> 10:55.550
Again, we will put it into.

10:59.290 --> 10:59.540
Help.

11:00.330 --> 11:01.380
So it takes.

11:02.070 --> 11:04.140
So we need to input base.

11:04.680 --> 11:10.650
And it needs the exponential value to what power we want to take it to.

11:13.440 --> 11:19.240
So here you can see this is one.

11:19.260 --> 11:20.340
How did we get it?

11:20.790 --> 11:23.490
We got it from Italy.

11:24.540 --> 11:27.090
And then we are trying to find the remainder of it.

11:27.930 --> 11:28.280
Right.

11:28.680 --> 11:32.890
So similarly, let's say Italy, Barbie.

11:33.360 --> 11:41.580
And then after that, we can simply get the remainder of it using this.

11:42.750 --> 11:43.550
This is the design.

11:43.920 --> 11:49.110
We did the same thing using two different operators.

11:49.110 --> 11:57.060
We can use the double star for the finding of the father.

11:57.420 --> 12:00.990
And also we can use my daughter Bella for the same operation.

12:01.200 --> 12:02.250
You can do it both ways.

12:05.370 --> 12:14.400
Next is rounding up a number to the nearest 20 thousand and the next multiple of this particular number.

12:16.200 --> 12:20.280
So these are two different things which we want to achieve now.

12:20.790 --> 12:27.810
One important thing is that when you want to try and round up a number, you can simply do that to a

12:27.810 --> 12:29.370
particular number of digits.

12:30.000 --> 12:33.890
So it is simple when you want to do it for a particular number of digits.

12:33.930 --> 12:37.140
So let's have a look at the round function.

12:40.340 --> 12:44.160
See, so that function gives us.

12:44.180 --> 12:49.850
It simply takes the number and it takes the number of digits you want to round the number do.

12:50.210 --> 12:52.370
So let's try this out.

12:52.820 --> 12:59.770
So we see a round and we give let's see, one, five, six, seven, some.

13:00.020 --> 13:01.130
What particular number?

13:01.400 --> 13:02.420
Let's do it this way.

13:02.630 --> 13:04.850
And we say let's save two.

13:04.970 --> 13:06.110
Let's see what happens.

13:08.060 --> 13:11.480
It doesn't do anything because here there are two numbers.

13:11.810 --> 13:12.980
Let's make it four.

13:17.250 --> 13:19.030
Now, what is happening?

13:19.050 --> 13:20.310
Nothing is happening here.

13:20.670 --> 13:23.850
So there is some problem with the direction.

13:24.270 --> 13:27.810
So let's put it out here and make it a floating point number.

13:28.110 --> 13:30.330
So I say two, three, four, five, six.

13:30.750 --> 13:32.790
I think a lot of numbers in front of it.

13:33.180 --> 13:35.550
Now let's do it as one.

13:36.540 --> 13:42.270
So it rounds it up to one decimal point.

13:43.680 --> 13:48.300
The next Big Three, it will rounded up to three decimal points.

13:48.930 --> 13:51.300
Now let's put minus three here in stack.

13:52.890 --> 13:57.060
So when we say minus three, it rounds up in the other direction.

13:57.360 --> 14:02.640
So we do not want to do it in a positive direction, but we want to do it in the negative direction.

14:02.970 --> 14:08.250
So we don't want to round up the best moves, but we actually want to round up the numbers.

14:09.450 --> 14:16.530
OK, so we want to rounded to the nearest 20000.

14:19.260 --> 14:21.090
So let's make it minus four.

14:23.380 --> 14:26.520
Well, that is something which we did not want.

14:27.510 --> 14:30.650
What is happening here is we have sixty seven hundred.

14:31.050 --> 14:41.220
So the nearest 20000 will be one five two oh one five.

14:43.040 --> 14:43.970
Twenty thousand.

14:44.360 --> 14:53.030
So this is thousand, so this is fifty six thousand, so the nearest twenty thousand would be one six

14:53.030 --> 14:53.660
seven zero.

14:53.690 --> 14:56.420
So let's complicate this number a little bit.

14:57.320 --> 14:59.190
Let's use some other numbers.

15:03.890 --> 15:08.960
So let's take it one by one, maybe.

15:10.220 --> 15:12.200
So this number.

15:13.130 --> 15:14.600
Let's take another number.

15:14.610 --> 15:16.100
Let's pick three numbers here.

15:42.650 --> 15:52.580
So the nearest 20 thousand to eighty one thousand will be 80000, the nearest 20000 to eighty nine thousand

15:54.380 --> 15:58.920
will be again 80000.

16:00.050 --> 16:05.870
The nearest 20000 to ninety one thousand will be one leg.

16:06.230 --> 16:07.700
So that is what we are expecting.

16:08.210 --> 16:10.640
So let's put it here first.

16:15.390 --> 16:19.380
It gives eighty thousand when we let's print all of these.

16:52.020 --> 16:59.220
So here you can see it is a rounding to the next or the nearest ten thousand right now.

16:59.520 --> 17:04.860
So for eighty one thousand, it is rounding to eighty thousand for eighty nine thousand nine hundred

17:04.860 --> 17:07.350
resounding to ninety thousand four ninety one thousand.

17:07.650 --> 17:09.120
It is rounding to 90000.

17:09.120 --> 17:11.940
So this is not rounding to the nearest twenty thousand.

17:12.330 --> 17:14.310
Back to the nearest ten thousand.

17:14.310 --> 17:16.770
But we are looking for the nearest twenty thousand.

17:18.240 --> 17:20.670
So let's get for them now.

17:21.390 --> 17:29.160
Let's divide this particular number with twenty thousand.

17:29.170 --> 17:31.020
So let me create another reading.

17:31.030 --> 17:33.870
Everything is equal to twenty thousand.

17:35.640 --> 17:42.480
And look, we divided with all these numbers, so I will simply divide it.

17:47.330 --> 17:47.840
Baby,

17:56.070 --> 17:59.390
and let's get rid of this.

18:04.460 --> 18:05.210
What do we have?

18:05.870 --> 18:07.820
We have four, four, five.

18:08.480 --> 18:11.840
And let's multiply it with the again.

18:20.770 --> 18:23.110
So here you get what we were looking for.

18:23.350 --> 18:31.000
Now, what we have simply done is because we wanted to find out what nearest multiple of 20000 it was.

18:31.240 --> 18:38.920
So we had to divide it by twenty thousand and then round the number and then multiplied with 20000 so

18:38.920 --> 18:41.170
that we could get a multiple of 20000 then.

18:41.680 --> 18:49.420
So this is how you find the multiples or you can see the nearest rounding for our particular numbers

18:49.420 --> 18:49.990
multiply.

18:50.950 --> 18:53.830
Now, let's see.

18:53.830 --> 18:55.330
I want to do this.

18:58.080 --> 19:01.020
With the next one.

19:01.290 --> 19:04.500
So here we are just rounding to the nearest twenty thousand.

19:04.740 --> 19:09.810
But let's say we want to noetic to the next multiple of twenty thousand.

19:09.840 --> 19:16.080
So in this particular case, the next multiple of twenty thousand four, eighty one thousand will be

19:16.290 --> 19:18.590
one like four eighty nine thousand.

19:18.600 --> 19:22.530
It will again be one lap for ninety one thousand and will again be one left.

19:22.560 --> 19:25.140
So these two values are wrong for now.

19:25.470 --> 19:26.640
So let's get this

19:30.210 --> 19:30.630
now.

19:30.900 --> 19:36.750
We want to round these numbers, but we want to round these numbers so that the decimal goes to the

19:37.050 --> 19:38.160
next number.

19:38.280 --> 19:41.790
We want to get the next upward value offered.

19:42.000 --> 19:47.340
So we simply find the stealing of the number instead of rounding up the number.

19:47.640 --> 19:51.240
What the ceiling give ceiling gives the output value.

19:51.250 --> 19:52.930
So we see.

19:54.450 --> 19:55.530
And scroll through down.

20:08.930 --> 20:14.870
Now, again, SEAL is a function of math library, so we will have to see my daughter.

20:21.430 --> 20:22.510
Now, let's get this.

20:22.870 --> 20:24.910
So here you get the results accordingly.

20:26.380 --> 20:34.420
So this was a pretty simple exercise, and it will take you through different mathematical operations,

20:34.420 --> 20:37.480
which you can come across in future.

20:37.720 --> 20:44.560
So it is fine if you faced a problem in solving some of the questions you will learn through the time

20:44.560 --> 20:46.060
once you keep on practicing.

20:46.450 --> 20:48.940
So let's go ahead with the next topic.

20:49.600 --> 20:50.080
Thank you.
