WEBVTT

00:00.490 --> 00:05.230
Sometimes you want to know the position of the value you want to remove from a list.

00:05.260 --> 00:13.330
If you only know the value of the item you want to remove, you can use the remove method.

00:13.510 --> 00:23.230
So for example, say we want to remove the value car Toyota from the list of car models in this case.

00:23.440 --> 00:29.860
In order in order to do that, we will enter the first car models dot remove here and we will enter,

00:29.860 --> 00:31.620
for example, Toyota.

00:31.630 --> 00:32.170
Right.

00:32.350 --> 00:34.620
So here we will.

00:34.630 --> 00:38.640
And after removing it, we will print the car models.

00:38.650 --> 00:39.640
That's it.

00:39.640 --> 00:42.550
As you can see here, we don't have the Toyota anymore.

00:42.580 --> 00:49.150
Before before the removal here, we had the this right.

00:49.360 --> 00:55.210
BMW was first, first Mercedes was second, second.

00:55.300 --> 00:58.300
And Toyota here is removed.

00:58.780 --> 01:01.760
So Toyota was third and Suzuki was fourth.

01:01.970 --> 01:08.890
So since the Toyota is removed here, the Suzuki changed this place to third.

01:08.930 --> 01:09.500
Right.

01:09.860 --> 01:10.610
Third.

01:10.870 --> 01:12.950
So we can change this place.

01:12.950 --> 01:15.650
Fourth to third.

01:17.870 --> 01:18.440
That's it.

01:18.830 --> 01:19.790
So.

01:21.360 --> 01:22.200
Uh, now.

01:23.720 --> 01:24.200
We can.

01:24.470 --> 01:29.090
As you can see here, we remove the item with just only name.

01:29.840 --> 01:34.670
So you can also use the remove method to work with the value that's being removed from a list.

01:34.670 --> 01:41.060
So let's remove the value Toyota and print a reason for removing it from the list.

01:41.180 --> 01:46.670
So in order to do that, we will use, for example, yes, print.

01:46.670 --> 01:47.600
And here.

01:47.960 --> 01:54.650
What's the reason for removing a Toyota from car models you casual, right?

01:54.680 --> 02:01.610
It has nothing almost in some Toyota models almost has nothing special compared to Mercedes, BMW and

02:01.610 --> 02:02.030
Suzuki.

02:02.030 --> 02:02.510
Right.

02:02.660 --> 02:04.850
Suzuki is not that special.

02:04.850 --> 02:07.820
But yeah, it's just an example here.

02:08.210 --> 02:10.790
So to casual.

02:12.500 --> 02:12.920
Or two.

02:12.950 --> 02:13.520
Standard.

02:13.670 --> 02:15.800
Two standard.

02:16.100 --> 02:19.400
And here we will enter the Toyota.

02:19.550 --> 02:21.530
Now, after that, we will.

02:24.400 --> 02:25.690
My car models.

02:26.480 --> 02:30.200
That remove the two standard, Right?

02:30.850 --> 02:37.600
So after that we will printing the car models and just write the reason for removal.

02:37.720 --> 02:41.080
So print F here.

02:44.080 --> 02:53.800
A and here to standard that title and after that is two standard.

02:54.980 --> 02:57.020
Start to drive.

02:58.920 --> 03:01.650
I want something special.

03:01.680 --> 03:02.340
Right.

03:02.370 --> 03:03.390
And here.

03:03.390 --> 03:04.080
That's it.

03:04.110 --> 03:07.020
At Toyota Center today, I want something special.

03:07.910 --> 03:14.330
And after defining the list, we assign the value Toyota to a variable called to standard.

03:14.360 --> 03:23.840
So when the we then use this variable to tell the python which value to remove the from the list, in

03:23.840 --> 03:28.070
this case, here in the ninth line we tell the python which.

03:29.760 --> 03:33.750
Number or which model to remove first.

03:34.200 --> 03:40.650
And here the Toyota has been removed from the list, but it's still accessible through the variable,

03:41.160 --> 03:42.420
uh, to standard.

03:42.420 --> 03:42.900
Right.

03:42.900 --> 03:49.980
And allowing us to print a statement about why we removed the Toyota from the list of motorcycles.
