1 00:00:11,860 --> 00:00:17,890 Hi, everybody, and welcome, and this lecture will discuss our fourth and last collection, which 2 00:00:17,890 --> 00:00:24,730 is Stop all this lecture will cover the basic part of the which will be followed by the dance spot with 3 00:00:24,730 --> 00:00:26,680 many examples, as always. 4 00:00:27,010 --> 00:00:33,350 OK, so let's begin this go straightforward to the characteristic list of Toppo. 5 00:00:33,640 --> 00:00:34,030 All right. 6 00:00:34,330 --> 00:00:42,310 So Toppo is indexed and ordered, meaning it has indexes for each cell. 7 00:00:42,440 --> 00:00:48,250 If we compare it to a dictionary or a set that is unordered and on the index. 8 00:00:48,280 --> 00:00:51,190 So in this case, we can extract values by index. 9 00:00:52,540 --> 00:00:56,210 Also, tuple cells cannot be changed, same as set. 10 00:00:56,230 --> 00:00:59,980 So once you created it, you cannot change Sayle values. 11 00:01:00,850 --> 00:01:09,190 And you can also you cannot you cannot add cells after you create the double and you cannot delete cells 12 00:01:09,190 --> 00:01:10,270 after you created. 13 00:01:10,510 --> 00:01:18,100 So these three tell us the tuple is a sort of speak a fixed collection, meaning after you create it, 14 00:01:18,430 --> 00:01:19,430 do not touch it. 15 00:01:20,110 --> 00:01:26,050 This is very useful, but nevertheless it's a bit challenging. 16 00:01:26,050 --> 00:01:33,550 So pay attention once you choose a collection, if you choose tuple, you will have a reliable data 17 00:01:33,700 --> 00:01:35,590 that will be there forever. 18 00:01:35,590 --> 00:01:40,540 It doesn't matter if you want to become a web developer or an information developer. 19 00:01:40,900 --> 00:01:44,050 This collection is very, very useful. 20 00:01:44,380 --> 00:01:44,860 All right. 21 00:01:45,460 --> 00:01:53,680 Also tuple is a single value Purcell collection, meaning if we compare it to a dictionary, we had 22 00:01:53,680 --> 00:01:57,340 there a key and the value for each cell. 23 00:01:57,340 --> 00:01:59,260 So we had two items in a cell. 24 00:01:59,470 --> 00:02:08,320 In this case, same as set and same as lists, we have only one item, Purcell and how actually tuple 25 00:02:08,320 --> 00:02:12,450 can be differentiated from a list. 26 00:02:12,580 --> 00:02:21,640 So once you see round brackets, you can identify definitely that we are discussing a tuple because 27 00:02:21,640 --> 00:02:26,160 a list has square brackets while tuple, has a round bracket. 28 00:02:26,180 --> 00:02:29,350 So this is what differentiates it from a list. 29 00:02:30,550 --> 00:02:30,920 All right. 30 00:02:30,930 --> 00:02:37,780 So from here, let's go straight ahead to our example that are following manipulations would be based 31 00:02:37,780 --> 00:02:43,720 on I saw I created a tuple May called professions in the industry. 32 00:02:43,720 --> 00:02:51,130 We have meaningful professions here, starting off with round brackets and the quotation marks, which 33 00:02:51,130 --> 00:02:58,770 will include Excel cell value and Yepp and the way divided with a comma right here. 34 00:02:59,260 --> 00:03:03,870 So we have front end back and they have all sensu same as last. 35 00:03:03,880 --> 00:03:06,750 This cell starts from index zero. 36 00:03:06,970 --> 00:03:10,720 This one is index one index to an index three. 37 00:03:12,130 --> 00:03:12,550 All right. 38 00:03:12,550 --> 00:03:16,360 So we can begin now with the basic manipulations upon tuple. 39 00:03:16,480 --> 00:03:21,070 So first thing first, let's see how can we access a sale by its index? 40 00:03:21,430 --> 00:03:27,700 So once we want to access a certain sale, we just mentioned the name of the tuple and use square brackets 41 00:03:28,360 --> 00:03:31,690 with the index cell number inside it. 42 00:03:31,960 --> 00:03:34,510 So pay attention and do not get confused. 43 00:03:34,930 --> 00:03:41,940 Once you create a tuple, you use round brackets, but once you want to extract the value from a top, 44 00:03:42,160 --> 00:03:43,970 you use square brackets. 45 00:03:44,380 --> 00:03:45,850 So this is very important. 46 00:03:45,860 --> 00:03:46,630 Remember it. 47 00:03:46,630 --> 00:03:51,460 And also, of course, as always, you're going to practice it and the following lecture. 48 00:03:52,980 --> 00:03:57,930 Next in line is, let's see, how can we access a sale by negative index? 49 00:03:58,300 --> 00:04:00,830 OK, we've seen this material in lists. 50 00:04:01,230 --> 00:04:08,130 So once we mentioned the couple name that the collection name and we put inside these square brackets, 51 00:04:08,160 --> 00:04:13,310 the number minus one, we will get the extraction of the last cell. 52 00:04:14,040 --> 00:04:16,060 So minus one means. 53 00:04:16,080 --> 00:04:19,860 Give me the last cell if you want one before last. 54 00:04:19,860 --> 00:04:24,990 Meaning this one just put minus two here and so on and so on. 55 00:04:25,560 --> 00:04:25,980 All right. 56 00:04:25,990 --> 00:04:32,940 So in our case, minus one, we'll extract us the Kuai value, which is the last cell value. 57 00:04:34,020 --> 00:04:40,830 And last in line is how can we access several cells of by range of indexes? 58 00:04:41,380 --> 00:04:48,690 Again, this material was mentioned in this lecture and I really advise you to go over it again if you 59 00:04:48,690 --> 00:04:49,470 got confused. 60 00:04:50,380 --> 00:04:58,140 And basically what that means is once we want to extract several values at once in a range of indexes, 61 00:04:58,350 --> 00:05:00,390 we should use the following technique. 62 00:05:00,570 --> 00:05:04,950 We just mentioned the name of the tuple and inside square brackets. 63 00:05:04,950 --> 00:05:05,940 We put the range. 64 00:05:05,940 --> 00:05:08,030 In our case, it's one till three. 65 00:05:09,060 --> 00:05:10,650 And if you recall. 66 00:05:11,550 --> 00:05:16,620 All right, so from this, this item is not included. 67 00:05:16,950 --> 00:05:19,920 All right, so in our case, we have cell number one. 68 00:05:21,280 --> 00:05:28,810 We have cell number two and cell number three is not included, so we'll get only the back end and their 69 00:05:28,840 --> 00:05:30,740 ops extraction in this case. 70 00:05:31,750 --> 00:05:37,990 OK, so basically it's a reversal to what we started in this, but here we applied it. 71 00:05:37,990 --> 00:05:42,430 And Toppo, I think this sums up the basic part of Toppo. 72 00:05:42,640 --> 00:05:48,980 As you can see, it has a bit different characteristics from the other collections. 73 00:05:49,120 --> 00:05:53,440 It has some similarity to set regarding changing values. 74 00:05:53,440 --> 00:05:58,900 But also in this case, you cannot add new cells and you cannot delete existing cells as well. 75 00:05:59,540 --> 00:06:05,900 And it's basically, as I mentioned, it gives us reliable data that will stay there forever. 76 00:06:06,310 --> 00:06:06,690 All right. 77 00:06:07,000 --> 00:06:10,260 So this concludes our first lecture off topic. 78 00:06:10,330 --> 00:06:12,010 I'll see you in the next video.