WEBVTT 00:01.730 --> 00:07.300 Data structure is a format in which data is stored and organized. 00:07.310 --> 00:10.680 In other words data structure is a collection of data. 00:11.710 --> 00:15.810 In that time we have for building data structures. 00:15.850 --> 00:21.300 List tuple dictionary and set first. 00:21.410 --> 00:23.590 We'll see list. 00:23.680 --> 00:29.290 The list is a general data structure widely used in pet and programs. 00:29.290 --> 00:32.400 It orders and ordered collection of items. 00:32.410 --> 00:38.940 It means that we can store sequence of items in a list to create a list. 00:38.990 --> 00:46.900 We give name to the list and the items in the list are enclosed by square brackets so here we are creating 00:46.960 --> 00:47.940 a list. 00:48.070 --> 00:55.310 You see it which is the name of the list and the items on the list are enclosed in square brackets. 00:57.560 --> 01:01.130 This list of items 1 2 3 4 5 01:07.000 --> 01:09.170 if you want to add a value to the list. 01:09.310 --> 01:10.270 We use append 01:26.490 --> 01:32.380 this will always add the new item to the end of the list. 01:32.730 --> 01:39.910 Like this to remove the item from the list we have. 01:42.180 --> 01:46.000 Let's suppose if we want to remove for you just before 01:55.270 --> 02:00.460 if you wanted to know how many items are there in the list we use land function 02:07.150 --> 02:11.110 if you wanted to count the number of occurrence of some item in the list. 02:11.220 --> 02:12.220 We will skunk 02:19.030 --> 02:20.770 so one is one time in the list 02:24.820 --> 02:27.500 to sort the list we see a dots or 02:33.720 --> 02:40.180 to sort the list in the worst say we saw 02:43.270 --> 02:44.860 rewards equal to 02:53.030 --> 02:57.530 we can assign a value of a list to another list. 03:01.560 --> 03:02.650 Now we have to list 03:12.060 --> 03:20.500 but remember that when we use equal to sign this will assign a reference of List A to B. 03:20.540 --> 03:23.420 It means if I append a 03:27.800 --> 03:29.380 B will also get appended 03:36.940 --> 03:39.290 to create a copy of the list. 03:39.340 --> 03:45.380 We can do new list with list big 03:49.100 --> 03:56.250 now if we append new list a new wonder school list dot and 04:02.340 --> 04:04.470 it will not affect a 04:16.520 --> 04:22.290 we can remove all items from the list by saying made it clear 04:30.890 --> 04:37.190 these were some list functions now we'll do some indexing on the list. 04:37.300 --> 04:40.720 So let's create the list again. 04:49.340 --> 04:58.080 So in certain the index indexes starts with 0 4 in the list it will have index value 0 2 will have 1 04:58.590 --> 05:02.940 3 ruler 2 and so on 2. 05:03.000 --> 05:07.270 Let's say grinned is 05:12.530 --> 05:14.620 in the list is 05:23.310 --> 05:24.960 give the index of the 05:29.180 --> 05:39.080 we can also specify the negative index so that negative index will start retrieving value from end of 05:39.090 --> 05:40.240 the list. 05:40.620 --> 05:41.250 Let's say 05:45.520 --> 05:48.870 charter schools 05:55.820 --> 06:00.040 apart from indexing again also do slicing on the list. 06:01.140 --> 06:09.000 Let's suppose we wanted to retrieve those three numbers from the list you say print 06:13.640 --> 06:17.890 the numbers. 06:18.520 --> 06:18.980 PA 06:29.420 --> 06:32.520 if you wanted to print the oldest we say 06:44.920 --> 06:56.000 if we wanted to retrieve like say print the list from there can I go yet. 06:59.200 --> 07:02.560 To do this we just simply scale 1 07:08.920 --> 07:13.830 since we can add remove or search the item in the list. 07:14.080 --> 07:22.600 We can say the list is a mutable data type that is this can be ordered we now see how to use list in 07:22.600 --> 07:23.550 our programs. 07:24.910 --> 07:26.770 They write a new program 07:30.420 --> 07:38.170 and we say for by you specify some lists but 07:44.060 --> 07:45.500 then I 07:50.200 --> 07:50.840 say that 07:59.380 --> 07:59.640 is 08:02.470 --> 08:03.440 right. 08:03.550 --> 08:11.800 This will print 1 2 3 4 5 you can also write the same program like the 08:30.830 --> 08:31.740 2. 08:31.810 --> 08:35.050 This is how we use list 1 in our programs.