1 00:00:13,520 --> 00:00:15,360 Welcome to this video now. 2 00:00:15,380 --> 00:00:23,030 We will try to resolve top practice parts and all right, so once you open your projects, create a 3 00:00:23,030 --> 00:00:27,410 new file as always, and you can give it a meaningful name. 4 00:00:27,410 --> 00:00:39,440 For example, collections, double practice, and here also collections type of practice. 5 00:00:40,970 --> 00:00:41,510 Yeah. 6 00:00:42,230 --> 00:00:52,290 So the first assignment you were asked to create a double with double off tech terms. 7 00:00:52,400 --> 00:00:52,730 Yeah. 8 00:00:53,060 --> 00:00:55,410 So let's create it. 9 00:00:55,430 --> 00:01:05,630 It was tech, not loggi, called terms like that and topolice obviously with round brackets. 10 00:01:05,630 --> 00:01:07,160 And we had Python here. 11 00:01:10,860 --> 00:01:12,210 And then picture. 12 00:01:15,090 --> 00:01:15,690 Topal. 13 00:01:18,000 --> 00:01:22,500 Collections and string like that. 14 00:01:23,280 --> 00:01:25,480 Yeah, so let's try to print it. 15 00:01:25,500 --> 00:01:29,620 So this is the first assignment. 16 00:01:29,940 --> 00:01:38,130 This is the Toppo collection and we have a year plus and technological terms like that. 17 00:01:38,700 --> 00:01:45,930 So what we did here basically just create a basic Thorpdale as what we had in the first assignment and 18 00:01:45,930 --> 00:01:46,810 then just print it. 19 00:01:46,950 --> 00:01:48,350 Let's see that we are OK. 20 00:01:50,010 --> 00:01:50,460 Great. 21 00:01:50,470 --> 00:01:54,060 So the top is printed successfully and from here. 22 00:01:54,090 --> 00:01:56,550 Let's go straight forward to the next assignment. 23 00:01:56,940 --> 00:02:02,430 And the second assignment was let's just mark here that this is assignment number one as well. 24 00:02:03,090 --> 00:02:04,290 Yeah, like that. 25 00:02:04,650 --> 00:02:12,330 An assignment number two was to print a sentence using. 26 00:02:17,380 --> 00:02:21,820 Using cell extraction. 27 00:02:23,410 --> 00:02:29,600 Regular, regular and Nygård negative. 28 00:02:29,690 --> 00:02:37,310 Yeah, so because the sentence is a bit long, I have it here on the other screen, so I'm just going 29 00:02:37,310 --> 00:02:41,870 to copy it to the publisher so it will be easier to print it. 30 00:02:42,950 --> 00:02:46,420 So this is the sense, the sentence we have error here. 31 00:02:47,150 --> 00:02:52,130 So we just put the comment Mark before it and we'll be fine. 32 00:02:52,760 --> 00:02:54,770 So let's put it here in the beginning. 33 00:02:54,800 --> 00:02:55,700 Yeah, like that. 34 00:02:56,120 --> 00:02:57,530 So this is the sentence. 35 00:02:57,710 --> 00:02:58,930 We're ninja developers. 36 00:02:58,940 --> 00:03:06,140 We write Python called in by Charmides and now practicing tuple collection stuff that contains a string 37 00:03:06,140 --> 00:03:07,050 of variables. 38 00:03:07,580 --> 00:03:17,810 So we have the words here and that's just try to print it as we were asked by using negative and regular 39 00:03:18,320 --> 00:03:19,020 extraction. 40 00:03:19,400 --> 00:03:23,390 So first of all, let's mark here that this is assignment number two. 41 00:03:23,600 --> 00:03:26,650 And let's begin first of all, we have regular words. 42 00:03:26,660 --> 00:03:26,960 All right. 43 00:03:26,980 --> 00:03:33,400 So we have we are ninja developers, right? 44 00:03:33,800 --> 00:03:34,940 And then we. 45 00:03:37,580 --> 00:03:49,670 We write and then we have the first word, which is we write Python and we marked it as a regular extraction. 46 00:03:50,060 --> 00:03:56,060 So regular extraction, it's this cell and this cell's index in regular extraction is zero. 47 00:03:56,330 --> 00:03:58,460 So let's just extract it. 48 00:03:59,030 --> 00:04:01,040 That's do a plus sign outside. 49 00:04:01,040 --> 00:04:06,170 It's outside the quotation mark because we want to insert a variable. 50 00:04:06,290 --> 00:04:07,460 So we do it like this. 51 00:04:07,550 --> 00:04:12,230 And then we just mention here the tuple and inside the square brackets. 52 00:04:12,440 --> 00:04:15,350 We just mention the cell number like that. 53 00:04:16,640 --> 00:04:23,110 Let's just print it for now so we'll know that we'll find that's our solution way is OK. 54 00:04:23,630 --> 00:04:24,050 Yeah. 55 00:04:25,190 --> 00:04:27,400 So it looks good so far, right. 56 00:04:28,130 --> 00:04:29,450 We are ninja developers. 57 00:04:29,450 --> 00:04:30,440 We write Python. 58 00:04:30,440 --> 00:04:30,630 Right. 59 00:04:30,650 --> 00:04:32,300 So, so far, so good. 60 00:04:32,870 --> 00:04:38,690 So from here inside the round brackets, because this is our present, you see it's marked in yellow 61 00:04:38,690 --> 00:04:38,990 here. 62 00:04:39,290 --> 00:04:42,210 So inside the round brackets, we want to continue. 63 00:04:42,230 --> 00:04:45,350 So we do it plus again and quotation marks to continue. 64 00:04:45,590 --> 00:04:52,930 And we write you code, right, because we're continuing starting from this word. 65 00:04:52,940 --> 00:04:54,440 So we need to continue this way. 66 00:04:54,440 --> 00:04:54,680 Right. 67 00:04:54,980 --> 00:05:01,370 Called in this regular string in and then we have PI charm. 68 00:05:01,790 --> 00:05:02,100 Right. 69 00:05:02,480 --> 00:05:09,150 So Pi Chameides was marked as negative extraction and we can start counting from here. 70 00:05:09,170 --> 00:05:16,330 This is, this cell is number minus one, negative counting minus two, minus three and minus four. 71 00:05:16,520 --> 00:05:22,610 So we need to mention the part, the tuple and inside the square brackets to. 72 00:05:22,610 --> 00:05:23,210 Right. 73 00:05:23,360 --> 00:05:24,260 Minus four. 74 00:05:24,320 --> 00:05:25,580 So I'm just going to copy it. 75 00:05:26,120 --> 00:05:27,050 Changed the number. 76 00:05:28,490 --> 00:05:28,910 Yeah. 77 00:05:28,910 --> 00:05:29,510 Right here. 78 00:05:29,900 --> 00:05:32,660 Plus and then right. 79 00:05:32,660 --> 00:05:33,620 Click and based. 80 00:05:34,040 --> 00:05:35,270 We have two classes here. 81 00:05:35,900 --> 00:05:36,280 Yeah. 82 00:05:36,290 --> 00:05:41,660 And inside the square brackets put minus four like that again. 83 00:05:41,660 --> 00:05:44,930 Let's just try to print it to see that we're in the right way. 84 00:05:46,010 --> 00:05:50,510 So we're ninja developers, we write Python called in pi charm. 85 00:05:50,510 --> 00:05:52,490 You see we have a small issue here. 86 00:05:53,030 --> 00:05:53,930 We don't have space. 87 00:05:53,940 --> 00:05:59,780 So after Python we need to put a space right here where the cursor is marking, blinking right now. 88 00:06:00,210 --> 00:06:03,170 So right here, let's try to print it again. 89 00:06:04,560 --> 00:06:05,520 And we're good. 90 00:06:06,150 --> 00:06:09,840 All right, so we are good to go. 91 00:06:11,430 --> 00:06:14,770 Let me just add here by picture ID, right. 92 00:06:15,390 --> 00:06:17,510 So let's run it. 93 00:06:18,300 --> 00:06:18,600 Yeah. 94 00:06:18,600 --> 00:06:20,910 By Charmides so let's continue. 95 00:06:21,030 --> 00:06:27,030 And after picture I.D., we have this and now practicing topical collections. 96 00:06:27,310 --> 00:06:32,550 And our next word is Toppo. 97 00:06:32,670 --> 00:06:33,090 Right. 98 00:06:33,270 --> 00:06:34,680 So this is our next word. 99 00:06:34,720 --> 00:06:38,640 So until this point, we just add a regular string again. 100 00:06:38,820 --> 00:06:45,120 So we have Bloss quotation mark and codine by Charmides and we have a comma. 101 00:06:45,210 --> 00:06:50,180 Right, because is this comma right here after Charmides, this comma right here. 102 00:06:50,520 --> 00:06:57,750 So we put the comma and and now back to seeing Toppo. 103 00:06:58,470 --> 00:07:01,830 Top Ball is marked for us in 104 00:07:04,260 --> 00:07:07,610 positive meaning, regular extraction. 105 00:07:07,890 --> 00:07:15,090 So we just put here a technological term and two because we have zero one and two. 106 00:07:15,690 --> 00:07:16,670 Right subtable. 107 00:07:16,680 --> 00:07:25,950 We extracted tuple right now and after tuple we have collection stop that will constrain string variables. 108 00:07:25,950 --> 00:07:28,260 So string is our next word. 109 00:07:28,260 --> 00:07:30,330 This one is our last extraction. 110 00:07:30,960 --> 00:07:33,410 So right now we are in trouble. 111 00:07:33,420 --> 00:07:35,020 So we need to continue from here. 112 00:07:35,310 --> 00:07:36,010 You know what? 113 00:07:36,120 --> 00:07:37,420 Let me just copy this one. 114 00:07:37,500 --> 00:07:38,730 Yeah, it's the same way. 115 00:07:38,740 --> 00:07:39,300 Copy. 116 00:07:39,420 --> 00:07:45,180 Just going to show you some shortcuts because instead of writing it in the keyboard, you can also copy 117 00:07:45,180 --> 00:07:45,360 it. 118 00:07:45,600 --> 00:07:49,800 So plus quotation marks and inside quotation mark, we can just. 119 00:07:49,980 --> 00:07:50,280 Right. 120 00:07:50,280 --> 00:07:51,210 Click and paste it. 121 00:07:51,210 --> 00:07:51,480 Right. 122 00:07:51,840 --> 00:07:52,470 The same thing. 123 00:07:53,730 --> 00:07:59,130 And now we need to extract the string, which is the last cell. 124 00:07:59,280 --> 00:08:02,820 And we were asked to do it in negative extraction. 125 00:08:02,830 --> 00:08:09,050 So just mentioning here plus in technological terms and square brackets minus one. 126 00:08:09,360 --> 00:08:09,690 Yeah. 127 00:08:10,140 --> 00:08:10,790 Like that. 128 00:08:11,070 --> 00:08:16,890 So now we need to just add the last word plus. 129 00:08:20,250 --> 00:08:29,010 Quotation marks and variables, yeah, like that, you see, it's it's a very, very long and we have 130 00:08:29,010 --> 00:08:29,850 a line here. 131 00:08:29,850 --> 00:08:32,940 Yeah, we have a line that goes from top to bottom right here. 132 00:08:33,270 --> 00:08:36,490 And we cannot market it because it's on the background. 133 00:08:36,630 --> 00:08:39,330 We'll see what we'll do it with it in a minute. 134 00:08:39,540 --> 00:08:42,030 That's just print it for now and see that we are OK. 135 00:08:43,010 --> 00:08:44,940 So we're in ninja developers. 136 00:08:45,090 --> 00:08:51,840 We write Python called in by Charmides and nonpracticing tuple collections topic that contains string 137 00:08:51,840 --> 00:08:52,560 variables. 138 00:08:52,800 --> 00:08:54,360 That's for now. 139 00:08:54,360 --> 00:08:56,880 Just add here a space after tuple. 140 00:08:58,320 --> 00:08:58,680 Yep. 141 00:08:58,860 --> 00:09:02,120 So practicing right here. 142 00:09:02,130 --> 00:09:02,490 Yeah. 143 00:09:04,200 --> 00:09:06,150 So now we should be fine. 144 00:09:06,460 --> 00:09:06,870 Yeah. 145 00:09:06,870 --> 00:09:08,100 So it's the same thing. 146 00:09:08,370 --> 00:09:15,900 We have the same sentence in the output as we were asked to do like that. 147 00:09:16,230 --> 00:09:16,500 Yeah. 148 00:09:16,500 --> 00:09:19,050 It's the same one is going to raise it. 149 00:09:20,940 --> 00:09:24,150 So we were great in this assignment. 150 00:09:24,420 --> 00:09:28,440 So you can see like the background line here that goes from top to bottom. 151 00:09:28,440 --> 00:09:36,090 It goes from from here under the name of the collection dictionary practice advanced here, the marker. 152 00:09:36,270 --> 00:09:40,440 And it goes through this word now and you can see line here. 153 00:09:40,740 --> 00:09:46,430 So if you see line it, it's here because PI Charm advises us not to cross this line. 154 00:09:46,620 --> 00:09:50,250 So our code would be would look static. 155 00:09:50,460 --> 00:09:52,560 So we don't want to cross this line. 156 00:09:52,560 --> 00:09:56,460 So everything that we have here, we would like not to cross this line. 157 00:09:56,460 --> 00:10:00,900 So the thing I'm going to do is right here to just hit enter. 158 00:10:02,790 --> 00:10:09,030 All right, they didn't do the job, so let's go a little bit back and forth here under a lot right 159 00:10:09,030 --> 00:10:12,930 after the four just hit enter here, right. 160 00:10:13,140 --> 00:10:15,750 And just backspace, the whole thing. 161 00:10:18,000 --> 00:10:25,180 Yeah, like that, and now for some reason, I have erased it. 162 00:10:25,200 --> 00:10:32,400 Yeah, so you see, for some reason I raised the square brackets here, so I just edit it, edit it 163 00:10:32,400 --> 00:10:33,500 in now. 164 00:10:33,840 --> 00:10:34,280 All right. 165 00:10:34,290 --> 00:10:38,340 We were OK, we're all we just passed the line a little bit. 166 00:10:38,340 --> 00:10:39,150 But that's all right. 167 00:10:39,330 --> 00:10:44,070 We're not we didn't not pass it a lot like it was before and now it looks more static. 168 00:10:44,070 --> 00:10:48,390 So you just hit the enter and make sure we don't have any errors. 169 00:10:48,600 --> 00:10:53,790 And you see, I hit the intro right after the square brackets here after the four. 170 00:10:54,030 --> 00:10:57,290 And let's just try to print it and see that we were OK. 171 00:10:57,480 --> 00:10:57,860 Yeah. 172 00:10:57,870 --> 00:10:59,670 So to see the output is fine. 173 00:10:59,790 --> 00:11:05,400 We didn't break anything and we're good to go for to the third assignment. 174 00:11:05,700 --> 00:11:11,610 So we have completed successfully the second assignment of printing out the sentence using negative 175 00:11:11,610 --> 00:11:14,220 and positive extraction. 176 00:11:15,000 --> 00:11:23,520 And the third assignment we were asked to do the following thing, insert float. 177 00:11:25,780 --> 00:11:36,640 And list variables into the tuple, so as you recall in the previous video, not the previous like the 178 00:11:36,640 --> 00:11:42,040 one before it once we discussed advanced Toppo, we mentioned the tuple. 179 00:11:42,730 --> 00:11:44,740 We cannot add variables. 180 00:11:44,740 --> 00:11:46,840 We can add cells into Toppo. 181 00:11:46,840 --> 00:11:49,020 We cannot modify it or delete it. 182 00:11:49,270 --> 00:11:57,940 So the trick here is to create a new collection of list and to pass all the items from the tuple to 183 00:11:57,940 --> 00:11:58,480 the list. 184 00:11:58,570 --> 00:12:07,540 And in the list we will add some new cells and then we will cast the list back to topple. 185 00:12:07,930 --> 00:12:08,250 Right. 186 00:12:08,590 --> 00:12:12,540 So you can see it, by the way, you can see it in the advanced part of tuple. 187 00:12:12,730 --> 00:12:18,590 There is an attachment file with all the material and you can see the example one by one right there. 188 00:12:18,820 --> 00:12:23,770 So first of all, let's create a deck technological terms list. 189 00:12:24,070 --> 00:12:27,090 Yeah, this would be a new collection. 190 00:12:27,760 --> 00:12:28,150 Yeah. 191 00:12:28,450 --> 00:12:35,940 And then we just mentioned we just do a casting of list and mention inside our toppled. 192 00:12:36,190 --> 00:12:42,780 So what we did here, actually we have casted our tuple into a list. 193 00:12:42,870 --> 00:12:43,210 Right. 194 00:12:43,510 --> 00:12:46,930 This one is casting same as we do in the printout. 195 00:12:46,930 --> 00:12:47,300 Right. 196 00:12:47,500 --> 00:12:48,940 Same as you did right here. 197 00:12:49,210 --> 00:12:51,560 We casted the top into a string. 198 00:12:51,580 --> 00:12:53,890 So now we're casting the tuple into a list. 199 00:12:54,100 --> 00:12:55,810 And this would be our list. 200 00:12:55,930 --> 00:13:04,360 And once we were dealing with a list, yeah, we can add new items so you can see the lecture that handles 201 00:13:04,540 --> 00:13:09,490 lists, the advanced part of lists that we previously studied. 202 00:13:09,670 --> 00:13:12,430 And you can see there how to add new cells. 203 00:13:12,640 --> 00:13:16,030 And the way to add new cells is using append action. 204 00:13:16,060 --> 00:13:16,390 All right. 205 00:13:18,880 --> 00:13:25,690 So we'll use a band and inside quotation marks, single double doesn't matter, we just add the items 206 00:13:25,690 --> 00:13:31,990 float and we will add the item list like that. 207 00:13:32,710 --> 00:13:38,710 And once we are done and again, we will mention the tuple equals. 208 00:13:38,890 --> 00:13:42,910 And now what we need to do is to cast the list. 209 00:13:43,090 --> 00:13:43,510 Yeah. 210 00:13:43,630 --> 00:13:45,820 This one back to topple. 211 00:13:46,000 --> 00:13:49,750 Right, with the new items inside it. 212 00:13:51,610 --> 00:13:51,930 All right. 213 00:13:51,940 --> 00:13:53,370 So you see what we did here? 214 00:13:53,380 --> 00:13:54,400 We have three steps. 215 00:13:54,400 --> 00:13:59,290 We have step number one, where we took the tuple and casted it into a list. 216 00:13:59,710 --> 00:14:01,390 And this will be our list. 217 00:14:01,930 --> 00:14:06,520 Then once we handle with the list, we added new items using a band action key. 218 00:14:07,210 --> 00:14:12,520 And the third step was to take this list and to cast it back. 219 00:14:12,520 --> 00:14:18,610 To topple and or topple will be equals to what we have here with the new items. 220 00:14:18,730 --> 00:14:22,690 And once we did that, we can just print it and have the new items inside. 221 00:14:25,540 --> 00:14:29,830 This is our new poll with the added cels. 222 00:14:30,930 --> 00:14:31,350 Yeah. 223 00:14:34,540 --> 00:14:37,910 Let's see the magic run. 224 00:14:38,620 --> 00:14:46,740 Yeah, so you can see here the output is successful, we have added float and less to support successfully. 225 00:14:47,290 --> 00:14:47,740 Great. 226 00:14:47,750 --> 00:14:50,300 So this was wasn't an easy assignment. 227 00:14:50,320 --> 00:14:51,340 This was a bit hard. 228 00:14:51,800 --> 00:14:57,940 So because we needed to involve your list also together with Toppo, but this is what programming is 229 00:14:57,940 --> 00:14:58,480 all about. 230 00:14:58,690 --> 00:15:03,730 You need to mix all the topics all together, because eventually when you're going to write code, you're 231 00:15:03,730 --> 00:15:10,180 going to use all the topics mixed together with string variables, lists, loops, eve statements all 232 00:15:10,210 --> 00:15:10,720 together. 233 00:15:11,090 --> 00:15:14,050 So it's a great example, great practice right here. 234 00:15:15,460 --> 00:15:23,050 And the first fourth assignment was to create a single cell tuple. 235 00:15:23,290 --> 00:15:23,710 Yeah. 236 00:15:24,040 --> 00:15:28,480 So single cell Toppo like that. 237 00:15:28,840 --> 00:15:32,100 And right here we studied that. 238 00:15:32,110 --> 00:15:39,790 What we need to do is not to leave it like this, but to add the camera here and then just print the 239 00:15:39,790 --> 00:15:40,450 single. 240 00:15:42,020 --> 00:15:43,130 Sell to Apple. 241 00:15:43,690 --> 00:15:53,480 Yeah, as always, just mentioning enter and also you were asked to bring the type of the top. 242 00:15:53,590 --> 00:15:55,680 You know what, you don't need to add a string here. 243 00:15:55,710 --> 00:16:02,360 Just mentioned the single celled Dupo and around it. 244 00:16:03,170 --> 00:16:10,160 Just use the action key type with round brackets. 245 00:16:10,550 --> 00:16:12,970 Let's print it and see that we're OK. 246 00:16:13,730 --> 00:16:14,140 Great. 247 00:16:14,210 --> 00:16:18,520 So we have printed it and also we can see here the type that is tuple. 248 00:16:19,250 --> 00:16:19,870 All right. 249 00:16:19,890 --> 00:16:23,360 This just add here a marker that it's the fourth assignment. 250 00:16:23,580 --> 00:16:27,240 And let's see what happens if we just remove the comma from here. 251 00:16:27,260 --> 00:16:27,530 All right. 252 00:16:27,740 --> 00:16:29,000 Let's just remove the comma. 253 00:16:29,690 --> 00:16:33,710 Once we remove the common, print it immediately. 254 00:16:33,890 --> 00:16:40,400 You can see here that the variable that mentions here in the type is integer. 255 00:16:40,400 --> 00:16:41,570 It became an integer. 256 00:16:41,660 --> 00:16:45,590 So only if you leave here the comma, this becomes a double. 257 00:16:45,830 --> 00:16:49,790 If you if you remove the comma, it's not double anymore. 258 00:16:49,790 --> 00:16:50,930 It becomes a variable. 259 00:16:50,990 --> 00:16:51,220 All right. 260 00:16:51,230 --> 00:16:56,860 So this very important thing and I think that we are done OK. 261 00:16:56,870 --> 00:17:00,530 So we have completed successfully the practice part of tuple. 262 00:17:01,010 --> 00:17:05,240 This was not an easy assignment list right here. 263 00:17:05,460 --> 00:17:12,920 And by now you can tap yourself on the shoulder and tell yourself, good job, because we have completed 264 00:17:12,920 --> 00:17:18,380 successfully all the variables part of the course and also all the collection part of the course. 265 00:17:18,650 --> 00:17:21,170 And that's a meaningful part. 266 00:17:21,320 --> 00:17:21,650 All right. 267 00:17:21,650 --> 00:17:26,150 That's about thirty or forty 40 percent of the python part. 268 00:17:26,360 --> 00:17:29,690 And we can go straight forward to the next topic. 269 00:17:30,050 --> 00:17:31,700 So that's about it. 270 00:17:31,700 --> 00:17:33,830 And I will see you in the next video.