WEBVTT

00:01.070 --> 00:02.820
So let's solve another question.

00:03.660 --> 00:07.080
We need to write a function for checking the speed of driver.

00:07.440 --> 00:10.650
This function should have one parameter which just speak.

00:11.610 --> 00:15.180
If the speed is less than equal to 70, it should print, OK.

00:15.510 --> 00:22.810
Otherwise, for every five km above the speed limit, it should give the driver one demerit point and

00:22.810 --> 00:25.060
bring the total number of demerit points.

00:25.680 --> 00:31.620
For example, if the speed is at the age of print 20 Bendu, if the driver gets more than 12 points,

00:31.620 --> 00:33.750
the function should be suspended.

00:34.920 --> 00:40.080
So this means that, first of all, we need to have a particular speed which should be inputted.

00:40.410 --> 00:43.200
So we need to know what is the speed of the person.

00:43.200 --> 00:45.270
So let's say we create speed.

00:47.780 --> 00:50.690
And let the value be well-funded.

00:51.980 --> 00:55.520
Now, for this particular speed, I want to create the function for myself.

00:56.810 --> 00:59.040
So what do we do here?

00:59.060 --> 01:01.130
Try to solve this question I do own.

01:01.640 --> 01:07.160
And if you're able to solve it, create if not, you will be solving it in a while.

01:08.730 --> 01:09.600
So try out.

01:20.450 --> 01:23.120
OK, so now let's try to solve this question.

01:23.330 --> 01:27.950
So it says if speed is less than 70, then it should be.

01:28.370 --> 01:29.840
So this is a simple condition.

01:30.230 --> 01:41.570
So we will simply say if speed is less than equal to 70, then Sprint

01:44.150 --> 01:51.740
OK, makes it seem otherwise.

01:51.770 --> 01:55.050
So either this or something is.

01:55.060 --> 01:56.780
So it has to be is.

01:59.870 --> 02:05.360
It was for every five km above the speed limit, 70.

02:05.900 --> 02:08.060
It should give the driver the midpoint.

02:08.070 --> 02:10.220
So let's give demerit points now.

02:10.730 --> 02:12.680
So let's create points.

02:12.920 --> 02:18.620
Two points is equal to and we give engager.

02:19.160 --> 02:24.500
And we say if now we will need to find the speed with just over.

02:24.770 --> 02:31.370
So it will be six feet minus 70.

02:31.580 --> 02:34.700
So this is what the speed is above 70.

02:35.030 --> 02:35.420
Right.

02:35.630 --> 02:37.470
If it is AP, it will give me 10.

02:37.490 --> 02:39.290
If it does nine, it will give me 20.

02:39.650 --> 02:45.120
Now, out of this, I need to find out what is the multiple of five?

02:45.140 --> 02:46.820
What is the multiple of five foot?

02:47.150 --> 02:49.610
So I will simply divide it by five.

02:53.480 --> 02:55.520
And why am I making it easier?

02:55.520 --> 02:59.030
Because I don't want it to be a floating point number.

02:59.030 --> 03:00.950
I simply want to get points for it.

03:00.950 --> 03:02.990
So there will be one point two point three point.

03:03.020 --> 03:06.200
There will never be something in between that.

03:06.500 --> 03:09.170
So I can simply print the point for place.

03:10.220 --> 03:12.590
So print flights for us.

03:13.400 --> 03:17.000
So when the speed is twelve hundred, it is saying that.

03:17.000 --> 03:19.760
So let's say the speed is C 50.

03:20.660 --> 03:25.640
So it is OK if the speed is still 170.

03:26.660 --> 03:28.070
It says 20.

03:28.310 --> 03:31.820
If the speed is let's say a hundred.

03:32.690 --> 03:33.620
It says six.

03:34.220 --> 03:38.990
So it is giving me points for every other point.

03:39.470 --> 03:47.360
So when speed is a hundred speed two hundred minus seventy divided by the that is thirty, divided by

03:47.360 --> 03:47.690
five.

03:47.690 --> 03:48.560
I get six here.

03:49.130 --> 03:49.970
Simple as that.

03:50.360 --> 03:53.860
Now, what I want to have is now this is already there.

03:53.870 --> 03:57.680
So every time the speed is increase, it really gives me this point.

03:57.800 --> 03:58.860
That is perfectly fine.

03:58.880 --> 04:00.440
It should give me what the point is.

04:00.830 --> 04:04.610
So I will simply say this is the statement which they need to.

04:04.610 --> 04:05.970
We will bring this only.

04:06.650 --> 04:07.760
So we will set

04:10.370 --> 04:10.990
points

04:15.050 --> 04:15.420
for this.

04:16.130 --> 04:17.020
So this is how it will.

04:17.030 --> 04:17.350
Correct.

04:17.900 --> 04:19.380
Now, for there what we want.

04:19.380 --> 04:25.460
But if the driver gets more than twelve points, then it should print license suspended.

04:25.460 --> 04:26.660
So when should it for in fact.

04:27.260 --> 04:37.340
So if points is greater than 12,

04:40.280 --> 04:45.710
then the print license suspended.

04:46.510 --> 04:47.300
Let's run this.

04:48.830 --> 04:52.240
So this needs to be in quotes.

04:56.060 --> 04:57.440
So it's saying six.

04:57.440 --> 05:00.560
If it is, see a higher value.

05:00.680 --> 05:02.720
It says license suspended.

05:03.140 --> 05:06.340
Now let's check it for some better value.

05:06.350 --> 05:07.190
So let's say.

05:13.140 --> 05:15.750
Five hundred eighty six.

05:16.010 --> 05:20.610
Nancy, three hundred forty six.

05:22.020 --> 05:24.990
Two hundred twenty six.

05:29.050 --> 05:29.430
120.

05:30.390 --> 05:38.070
Then one third, the 151.

05:39.750 --> 05:43.860
Still the same FAA license suspended.

05:44.730 --> 05:45.150
They.

05:48.770 --> 05:50.040
So it's fine.

05:50.060 --> 05:52.130
I hope you were able to solve this.

05:52.550 --> 05:54.440
Now we'll go to the next problem.
