1 00:00:05,330 --> 00:00:09,740 Hey I've even seen the last video we have done with the mentors. 2 00:00:09,750 --> 00:00:10,330 No. 3 00:00:10,520 --> 00:00:13,880 In this video we are going to cover the indexing and slicing. 4 00:00:13,980 --> 00:00:19,720 That is we have also done with the least and that nearly seem like the least. 5 00:00:19,760 --> 00:00:32,420 So here if you have a list or we can just create one with the and B don't agree and we will use the 6 00:00:32,420 --> 00:00:35,150 range function instead of this one. 7 00:00:35,150 --> 00:00:36,060 So we have. 8 00:00:38,060 --> 00:00:46,480 And let me create something like from 1 to 20 or 21 so that 20 will also be included. 9 00:00:47,380 --> 00:00:54,530 So now x x here we have this 1 1 2 20 now. 10 00:00:54,830 --> 00:01:01,070 Simple like the list if you want to access any element like I want to access 9 so it will be on the 11 00:01:01,070 --> 00:01:05,110 index 8 and here we have 9. 12 00:01:05,710 --> 00:01:11,240 If you want to access element from negative then we have here minus 1. 13 00:01:11,320 --> 00:01:20,360 Only 20 you can access early element you want to by 13. 14 00:01:20,430 --> 00:01:25,020 Here we have 40 and slicing also same for the one D. 15 00:01:25,200 --> 00:01:30,110 That is you can just use like from 0 to up to 10. 16 00:01:30,360 --> 00:01:32,560 You will have one group. 17 00:01:33,360 --> 00:01:35,970 And here we also get the 10. 18 00:01:36,060 --> 00:01:38,940 But we do not get the end. 19 00:01:39,290 --> 00:01:41,170 All we can see that the range on that one. 20 00:01:41,370 --> 00:01:47,420 Actually this 10 is for eleven because the 11 is on the next end. 21 00:01:47,610 --> 00:01:53,090 So I have used that zero also otherwise it will confuse you a little bit. 22 00:01:53,100 --> 00:01:55,050 So here we have this one now. 23 00:01:55,620 --> 00:02:00,800 And if we do the same things here we will get the results like these. 24 00:02:01,170 --> 00:02:02,780 And now here we have nine. 25 00:02:02,820 --> 00:02:04,390 Then I begin from zero. 26 00:02:05,370 --> 00:02:13,630 And if you want the last one from ten like from after the tenth you can do something like this one then 27 00:02:13,630 --> 00:02:15,190 you will get the upper portion. 28 00:02:15,190 --> 00:02:17,860 That is from 10 to 20. 29 00:02:17,860 --> 00:02:19,560 Here we have up to nine. 30 00:02:20,110 --> 00:02:25,360 And you can slice portion like from two to five. 31 00:02:25,590 --> 00:02:29,930 Then it will include 0 1 2 from 2 to 4. 32 00:02:30,190 --> 00:02:31,330 Upper will not be counted. 33 00:02:31,360 --> 00:02:36,050 So here when you hit enter you have two three and four. 34 00:02:36,430 --> 00:02:41,500 So that's how you can also split the list. 35 00:02:41,500 --> 00:02:43,490 And here we have nine. 36 00:02:43,570 --> 00:02:48,920 So this is these slicing off lists and that tone is indexing in case of one day. 37 00:02:49,340 --> 00:03:02,860 Now one more thing about the when the slicing is like here we have done these if you want to have slicing 38 00:03:02,860 --> 00:03:04,570 with negative ones. 39 00:03:04,570 --> 00:03:12,310 Then if I do from negative 10 to negative 1 you can just pass the values in negative. 40 00:03:12,970 --> 00:03:14,830 So that's how in the negative. 41 00:03:14,830 --> 00:03:19,030 Then we have the 11 and we have done a two minus over one. 42 00:03:19,030 --> 00:03:24,310 So here 20 will not be included because that one is the range. 43 00:03:24,370 --> 00:03:27,400 In that case here this one is orange. 44 00:03:27,610 --> 00:03:32,110 So that is how you can split the list with negative numbers also. 45 00:03:33,070 --> 00:03:40,780 Now and then the thing that is something like If you have a variable flight and that is equal to x so 46 00:03:41,050 --> 00:03:48,610 like let you take something like from 5 to 50. 47 00:03:48,660 --> 00:03:53,580 And to assign them a value like here for the hit enter. 48 00:03:53,580 --> 00:03:59,150 If you print why you will have the numbers of element that will be in five to 15. 49 00:03:59,150 --> 00:04:06,330 That is 1 2 3 4 5 6 7 8 9 10 and 15 is not included. 50 00:04:06,330 --> 00:04:12,580 So 10 element but all the elements will be equal to 40 because we have assigned a value 40. 51 00:04:13,260 --> 00:04:22,440 And now if you tried to print Excel so that all elements that are in there replaced by 40 because this 52 00:04:22,440 --> 00:04:29,400 latest portion that the variable VI has now is the same part of this one we are just visualizing that 53 00:04:29,400 --> 00:04:29,820 part. 54 00:04:30,330 --> 00:04:35,800 And if you make any changes with that the changes will also currently or is null. 55 00:04:36,780 --> 00:04:44,350 So to make any changes in any of these list you can just copy that list and to copy just right next 56 00:04:44,370 --> 00:04:48,300 door copy and differences shift enter. 57 00:04:48,300 --> 00:04:55,860 Now if you print why you have that one equal to x that is 0 1 2 3 4 and then all default is up to 15 58 00:04:56,400 --> 00:04:59,130 then from 15 to 20. 59 00:04:59,490 --> 00:05:07,340 Now you can make the changes invite directly instead of making changes X and assigning that do y. 60 00:05:07,410 --> 00:05:10,930 Now the original will not get replaced if you do the same thing like here. 61 00:05:10,950 --> 00:05:11,440 This one. 62 00:05:11,440 --> 00:05:14,950 Come on see here come on V. 63 00:05:14,970 --> 00:05:27,290 And now this one is already way and let this one be it the So shift center. 64 00:05:27,290 --> 00:05:36,350 If you have I know all this will become a D and the X is like the original then that is the 40s. 65 00:05:36,520 --> 00:05:42,870 So that's how you can make changes in any list by copying that list and performing the operation. 66 00:05:43,000 --> 00:05:48,700 So in the next video we will do the same thing with two dearie or two remarriages so thanks for watching 67 00:05:49,210 --> 00:05:50,380 and seeing in the next video.