So let's solve another question.
We need to write a function for checking the speed of driver.
This function should have one parameter which just speak.
If the speed is less than equal to 70, it should print, OK.
Otherwise, for every five km above the speed limit, it should give the driver one demerit point and
bring the total number of demerit points.
For example, if the speed is at the age of print 20 Bendu, if the driver gets more than 12 points,
the function should be suspended.
So this means that, first of all, we need to have a particular speed which should be inputted.
So we need to know what is the speed of the person.
So let's say we create speed.
And let the value be well-funded.
Now, for this particular speed, I want to create the function for myself.
So what do we do here?
Try to solve this question I do own.
And if you're able to solve it, create if not, you will be solving it in a while.
So try out.
OK, so now let's try to solve this question.
So it says if speed is less than 70, then it should be.
So this is a simple condition.
So we will simply say if speed is less than equal to 70, then Sprint
OK, makes it seem otherwise.
So either this or something is.
So it has to be is.
It was for every five km above the speed limit, 70.
It should give the driver the midpoint.
So let's give demerit points now.
So let's create points.
Two points is equal to and we give engager.
And we say if now we will need to find the speed with just over.
So it will be six feet minus 70.
So this is what the speed is above 70.
Right.
If it is AP, it will give me 10.
If it does nine, it will give me 20.
Now, out of this, I need to find out what is the multiple of five?
What is the multiple of five foot?
So I will simply divide it by five.
And why am I making it easier?
Because I don't want it to be a floating point number.
I simply want to get points for it.
So there will be one point two point three point.
There will never be something in between that.
So I can simply print the point for place.
So print flights for us.
So when the speed is twelve hundred, it is saying that.
So let's say the speed is C 50.
So it is OK if the speed is still 170.
It says 20.
If the speed is let's say a hundred.
It says six.
So it is giving me points for every other point.
So when speed is a hundred speed two hundred minus seventy divided by the that is thirty, divided by
five.
I get six here.
Simple as that.
Now, what I want to have is now this is already there.
So every time the speed is increase, it really gives me this point.
That is perfectly fine.
It should give me what the point is.
So I will simply say this is the statement which they need to.
We will bring this only.
So we will set
points
for this.
So this is how it will.
Correct.
Now, for there what we want.
But if the driver gets more than twelve points, then it should print license suspended.
So when should it for in fact.
So if points is greater than 12,
then the print license suspended.
Let's run this.
So this needs to be in quotes.
So it's saying six.
If it is, see a higher value.
It says license suspended.
Now let's check it for some better value.
So let's say.
Five hundred eighty six.
Nancy, three hundred forty six.
Two hundred twenty six.
120.
Then one third, the 151.
Still the same FAA license suspended.
They.
So it's fine.
I hope you were able to solve this.
Now we'll go to the next problem.