WEBVTT

00:00.410 --> 00:07.610
You can use pop to remove an item from any position in a list by including the index of the item you

00:07.610 --> 00:09.290
want to remove in parentheses.

00:09.320 --> 00:12.500
So now we will add, for example, zero, right?

00:12.650 --> 00:15.020
Let's delete the BMW here and now.

00:15.380 --> 00:18.200
The last car model I owned was a BMW.

00:18.230 --> 00:24.090
We start popping the first car model in the list and then we print a message about that car model.

00:24.110 --> 00:29.480
The output is a simple sentence describing the first car model I have ever owned.

00:29.960 --> 00:37.950
Remember that each time you use the pop, the item you work with is no longer stored in the list.

00:37.970 --> 00:45.590
So actually, let's try it with our first created code, which you can download from attachments.

00:45.620 --> 00:51.020
Now let's let's see what will happen if we try that same example list.

00:51.020 --> 00:57.800
And as you can see here, we no longer have BMW here and instead we have popped the BMW variable and

00:57.800 --> 00:58.700
pop car model.

00:58.700 --> 01:01.590
So the pop car models as I said earlier, this is not a list.

01:01.590 --> 01:06.870
This is just a variable that holds the pop car pop value here.

01:07.700 --> 01:13.880
So if you are unsure whether to use the Dell statement or the pop method, here's a simple way to decide.

01:13.910 --> 01:23.340
So when you want to delete an item from a list and not use that item in any way, you can use the Dell.

01:23.390 --> 01:26.270
You can use the Dell statement.

01:26.630 --> 01:34.010
If you want to use an item as you remove it, you use the pop.
