WEBVTT 00:01.060 --> 00:05.010 Hey guys who come back to you when you in this video let's talk about please. 00:05.160 --> 00:11.490 So by the name itself we can understand it this collection of some items which is stored in a variable 00:11.730 --> 00:16.070 and in that we will all the items will be according to an order. 00:16.260 --> 00:19.380 So the basic example is at a grocery list. 00:19.440 --> 00:25.150 So whenever your mom tells you to bring these item she might give you a list and that list have similar 00:25.200 --> 00:26.070 item. 00:26.310 --> 00:28.200 So same for those with Python. 00:28.470 --> 00:34.820 So we take away the will and that particular variable we can store multiple elements and that can be 00:34.830 --> 00:39.330 string that can be list that can be double that can be in danger. 00:39.330 --> 00:43.670 That can be a flow and all the items will be stored in a ordered manner. 00:43.800 --> 00:51.540 That means if an item is stored at your position it will remain at zero position unless and until we 00:51.540 --> 00:52.890 try to make some change. 00:53.030 --> 00:55.900 So list is an ordered element can be not. 00:56.130 --> 00:58.270 So let me take a simple list here. 00:58.290 --> 01:02.630 If Hartig X as a variable and store some element. 01:03.030 --> 01:09.990 So had I created a sample list so there are five elements all the imports that I give inside a list 01:10.050 --> 01:16.530 is an element has shown is an element 22 do is the byte on and fifty five point five. 01:16.680 --> 01:18.160 These all are elements. 01:18.330 --> 01:23.820 But now let us brush up some basic thing so you can store different types of data type inside out. 01:23.820 --> 01:27.870 That means you can store tables you can short list whatever you want. 01:27.870 --> 01:31.440 Second thing is that indexing oftenest start from zero. 01:31.510 --> 01:37.650 So the elementary is on zero position the element when you do is at first Felician and the next thing 01:37.650 --> 01:40.100 that I wonder about Colobus list is mutable. 01:40.230 --> 01:45.720 That means you can add more elements inside the list you can delete some elements maybe you want to 01:45.720 --> 01:49.690 delete this element fifty five point five and add some other element. 01:49.860 --> 01:51.360 So the list is mutable. 01:51.360 --> 01:56.820 That means you can edit that list at any point of pain during exhilaration of your program. 01:57.090 --> 01:58.800 So let us start with indexing. 01:58.800 --> 02:04.580 So if I want to print also an element of A list all I can do is be the variable name. 02:04.650 --> 02:08.260 The square brackets and I need to get indexing position. 02:08.400 --> 02:14.730 So if I want to pick up C se I just want to get the second expedition and if I do that you can see I 02:14.730 --> 02:18.380 just called The reason I can store them inside the variable. 02:18.500 --> 02:24.280 So if I did Y and perform the same for the second Felician and try to play. 02:24.340 --> 02:26.730 Now you can see I just got the result. 02:26.910 --> 02:28.820 So this is one of the important thing. 02:28.890 --> 02:35.850 And remember your X is a single variable which is containing these multiple elements with the help awfullest. 02:35.880 --> 02:37.850 The next thing I want to talk about is land. 02:37.920 --> 02:44.370 So at any point of time you want to find out of this particular list all you have to do is use the function 02:44.790 --> 02:49.260 and simply do that and pass out my variable of the list. 02:49.320 --> 02:55.740 You can see I got the length of this particular illness so the lens will be equal to the number of elements 02:55.740 --> 02:57.510 inside that particular list. 02:57.510 --> 03:03.250 Now the next thing that we should talk about this matter is while talking about string I don't do that. 03:03.240 --> 03:09.930 Matter is different for every sequence so string has their own method like about one which will not 03:09.930 --> 03:13.150 be present for this list has its own method. 03:13.230 --> 03:17.450 Maybe some PAUP have been installed count. 03:17.490 --> 03:19.030 There are several methods. 03:19.170 --> 03:21.520 So which will not be present in string. 03:21.600 --> 03:27.780 Maybe someone has their own mentors so MetroWest will be different for each sequence. 03:27.780 --> 03:30.330 Now let's try some method with our list. 03:30.360 --> 03:35.690 Let me take my variable x at a door and then I need to add a meter. 03:35.850 --> 03:41.670 So if you're using at home if you're using pi charm you will get the help of intellisense. 03:41.850 --> 03:46.400 So that will help you and give you an idea of different methods available. 03:46.560 --> 03:50.040 So this was the main reason I switched to come on line. 03:50.190 --> 03:55.440 So we get the value of why you are using atom and different IDs. 03:55.440 --> 04:02.500 Let me switch back to my item so I can explore a number of models and back on my own. 04:02.590 --> 04:08.640 So what have done all we have to do is take X than not and now you can see a lot of matters. 04:08.650 --> 04:11.550 So this is the reason I prefer ID. 04:11.800 --> 04:18.470 Now the basic one that I want to use force me is inside with the help of so you can add element it does 04:18.730 --> 04:19.750 in position. 04:19.930 --> 04:22.680 So all I can do is get the position. 04:22.770 --> 04:28.530 So if I want to add my surname politian one remember I'm talking about an expedition. 04:28.720 --> 04:34.170 So all I have to do is get the position on the element that I want to enter. 04:34.360 --> 04:41.560 So whenever this is have to execute it will add my name and falshood you can literally print X and run 04:41.560 --> 04:43.970 the script. 04:44.040 --> 04:48.260 You can see I got Shubham then I work on a new element that is Sharda. 04:48.330 --> 04:51.910 Then when you do see a seed Python fifty five point five. 04:52.140 --> 05:00.240 So now the index version of the remaining element shifted plus 1 and at position 1 we have a new element 05:00.240 --> 05:01.710 which is Sharda. 05:01.710 --> 05:03.420 Now let me clear this up. 05:03.420 --> 05:05.800 And the second I need to perform is rimu. 05:05.870 --> 05:12.580 So any point of time if I want to remove any element from my list I just need to use to move matter 05:12.810 --> 05:16.300 and I just was the element that I want to remove. 05:16.470 --> 05:18.080 So let us work on that. 05:18.070 --> 05:25.880 So I will take X and then I'll have two boxes removed and then pass the element which I want to remove. 05:26.280 --> 05:35.940 And let me add Prince Freedman to my homework the and I've been forced into that first position and 05:36.420 --> 05:39.950 then I've been removed CHC and then printed again. 05:40.300 --> 05:48.110 Let me run this one now with the result you see I am in charge of the first user and the second is our 05:48.180 --> 05:49.850 I remove CSC. 05:49.860 --> 05:53.360 Now the third thing I want to perform is Wadih in a list. 05:53.370 --> 06:00.770 There are several easy to remember which of us is going to have the Louis in the expedition will be 06:00.800 --> 06:02.200 deleted first. 06:02.250 --> 06:11.190 So if I have to see it here and if I tried to run this one again you can see the facias see which was 06:11.190 --> 06:13.070 available in the last remove. 06:13.200 --> 06:16.630 And the second CHC which was available will mean. 06:16.800 --> 06:19.960 So all you need to check is Louis in the expedition. 06:20.160 --> 06:24.110 And if you want to remove the last element you can use pop. 06:24.270 --> 06:26.580 So Bachman-Turner is really easy. 06:26.610 --> 06:28.780 So you have to do is right pop. 06:28.930 --> 06:32.470 So this function directly to move the last element. 06:32.700 --> 06:40.370 So if I just clear this up and run the whole Again you can see the last CAC is now gone from my list. 06:40.410 --> 06:43.290 I hope these matters are easy to understand. 06:43.290 --> 06:45.580 Now what if I want to delete my list. 06:45.600 --> 06:52.320 So while working with find find working with big functions you might create a list of some item and 06:52.320 --> 06:57.710 then distribute these item in two different variable and then the list is not useful. 06:57.930 --> 07:01.030 So I believe the list all we have to use is DTL. 07:01.080 --> 07:08.080 Then we have to pastoralist name and delete that list or not is the end of the list name. 07:08.130 --> 07:08.990 That's right. 07:09.120 --> 07:14.570 And if after deleting that list if I try to print this I might get an error. 07:14.610 --> 07:21.300 So let me run this come on you can see I got the error because that X is not defined. 07:21.330 --> 07:27.600 That means once the list is deleted it is not present in our memory that is it has not been present 07:27.600 --> 07:29.270 in our garbagemen will be. 07:29.520 --> 07:31.840 And what if I just want to be rebellious. 07:32.010 --> 07:34.280 I don't want to delete the elements. 07:34.350 --> 07:39.230 So for that all you have to do is use X then dot net here. 07:39.300 --> 07:42.260 So if you do that let us run this come on. 07:42.440 --> 07:47.580 So you can see I got the empty list that means it will delete all the elements in the list and if I 07:47.580 --> 07:54.210 use dnd that means to delete the whole list from our memory the next method I want to talk about this 07:54.210 --> 07:58.450 or so if you have a list and that list contains all the. 07:58.450 --> 08:00.510 Indeed those are all the float. 08:00.630 --> 08:01.980 Then you can solve that. 08:02.070 --> 08:08.340 So all you have to do is use a soft matter and then try to print out the result. 08:08.550 --> 08:15.240 You can see I got the error because as I told you we need to do that with integers or flow. 08:15.360 --> 08:19.190 Let me create a new list of the elements. 08:19.290 --> 08:23.310 Use a sort function to run this. 08:23.310 --> 08:29.540 Now you can see I got the result from listening to listening and if I don't believe that I can use Archibald's 08:29.670 --> 08:41.320 function as well next door Trevose and high levels and hoping that you can see I just are descending 08:41.320 --> 08:42.370 to ascending. 08:42.370 --> 08:44.740 So these are really useful function. 08:44.860 --> 08:48.030 The next important function I want to talk about is pain. 08:48.280 --> 08:51.100 Lately we're using pop to delete the last element. 08:51.250 --> 08:56.800 But if we want to add multiple elements at the last position so we can use a pen. 08:57.010 --> 09:01.470 So with this list all I have to do is use a brain function. 09:01.630 --> 09:03.730 And then I need to pass that element. 09:03.910 --> 09:12.390 So if I pass 70 and try to print out my list you can see seven days added to my last position and a 09:12.390 --> 09:18.310 number of whatever we are doing with this list will be seeing that means just want them pretty. 09:18.310 --> 09:20.350 This is of x variable. 09:20.410 --> 09:22.980 So it is added in that X-51. 09:23.020 --> 09:26.740 It is not just a temporary thing it's a permanent change. 09:27.070 --> 09:33.670 So like we are using pop to read last element we can use append to add something and the last element. 09:33.700 --> 09:36.100 The next thing I want to talk about is gone. 09:36.490 --> 09:43.950 And if I add an element like 20 22 it will give me the result that how many times this element is present 09:43.960 --> 09:45.580 in this particular list. 09:45.770 --> 09:51.380 And don't forget that count and then start to play different lane to give you a number of the element 09:51.550 --> 09:57.490 that is the length of the list can give you the number of that particular element is present. 09:57.490 --> 10:03.180 So if I'm going to do it it's going to give me a result of one that means only one time. 10:03.230 --> 10:06.730 This 22 element is present in our last 10:10.550 --> 10:12.560 that and you can see the output. 10:12.710 --> 10:13.820 Give me one. 10:14.060 --> 10:20.630 So what if I add my elements in this list maybe 22 again then 70 then 22 again. 10:20.840 --> 10:25.680 And if I run this come on I mean you're going to see the result of three. 10:25.720 --> 10:32.500 That means this particular element is present 40 times it is really really really important to count 10:32.600 --> 10:36.780 LMM sometimes maybe five big basic examples. 10:36.820 --> 10:39.880 You have a list of names of several students. 10:39.970 --> 10:44.790 So for one particular name you might need to check that how many students are present. 10:44.930 --> 10:49.400 So in that list you can do that or maybe you want to find a duplicate. 10:49.480 --> 10:53.320 So you have done and you can check out how many duplicates of prison. 10:53.500 --> 10:55.580 So you can do a lot with them. 10:55.690 --> 10:57.580 So the list is really important. 10:57.730 --> 11:01.530 All you have to remember is it is ordered it is mutable. 11:01.680 --> 11:06.160 So yeah this was one important section to talk about list in the next letter. 11:06.160 --> 11:12.190 Let's talk about more sequences and cleared up some notes.