1 00:00:17,250 --> 00:00:27,720 So what I'm going to do now basically is to resolve the homework and we're going to try and do it together. 2 00:00:30,390 --> 00:00:34,940 I'll just open the project, as we did in last lectures and this window. 3 00:00:35,100 --> 00:00:35,580 All right. 4 00:00:36,820 --> 00:00:38,020 And. 5 00:00:39,940 --> 00:00:41,140 That's great, Hugh. 6 00:00:41,150 --> 00:00:43,180 A new file called. 7 00:00:44,440 --> 00:00:47,720 Variables, homework. 8 00:00:48,670 --> 00:00:51,170 I'm just going to mention a small quick note. 9 00:00:51,190 --> 00:00:59,540 All right, once you create classes or in other words, a module and become, you have to start with 10 00:00:59,540 --> 00:01:00,480 the capital letter. 11 00:01:00,490 --> 00:01:02,970 We already discussed it in the previous lecture. 12 00:01:02,980 --> 00:01:06,910 But if you have several words, just stick them all together. 13 00:01:07,000 --> 00:01:15,040 And each and every word will start with a capital case, meaning capital letter at the beginning of 14 00:01:15,040 --> 00:01:16,690 every war that you have. 15 00:01:17,380 --> 00:01:18,100 All right. 16 00:01:18,730 --> 00:01:31,600 So the headline will be like this string variables, homework, practice. 17 00:01:32,240 --> 00:01:32,620 Right. 18 00:01:33,200 --> 00:01:45,430 And the first assignment was to create a sorry guys windows serial number variable that each value will 19 00:01:45,430 --> 00:01:50,950 be A, B, C, D, E, F, G, H, I and J, k, l. 20 00:01:51,670 --> 00:01:52,120 Great. 21 00:01:52,960 --> 00:01:57,220 So let's just mention that this is part one. 22 00:01:57,580 --> 00:02:00,220 Create a simple variable. 23 00:02:01,610 --> 00:02:04,550 With the following values. 24 00:02:12,340 --> 00:02:22,660 All right, so let's head up to the second part, which is part two, and we talked about using the 25 00:02:22,660 --> 00:02:30,490 index and ranges to take part of the original string. 26 00:02:31,270 --> 00:02:31,830 Correct. 27 00:02:32,890 --> 00:02:34,440 So let's try to do it. 28 00:02:34,450 --> 00:02:40,810 Let's just do let's just do give the first the names new partial. 29 00:02:40,810 --> 00:02:42,550 You can give any name you want. 30 00:02:44,080 --> 00:02:46,210 As long as it is. 31 00:02:48,360 --> 00:02:55,680 As long as who reads it can understand what your meaning here, as long as it's a meaningful name. 32 00:02:55,700 --> 00:02:55,970 All right. 33 00:02:55,970 --> 00:02:58,100 So it's very important to give meaningful names. 34 00:02:58,670 --> 00:03:07,670 So I'm just going to create four of these and just change the last letter here to indicate the difference 35 00:03:07,670 --> 00:03:08,420 between them. 36 00:03:09,260 --> 00:03:18,110 And right now, as I just mentioned in the hint, we're going to use we're going to just take the original 37 00:03:18,790 --> 00:03:19,730 a variable. 38 00:03:19,740 --> 00:03:20,140 Right. 39 00:03:20,180 --> 00:03:30,980 You see, it's you have a pop up of to completion here from just hit enter whoopsie again and then square 40 00:03:30,980 --> 00:03:31,580 brackets. 41 00:03:31,580 --> 00:03:38,180 And I'm just going to take the zero to three values and this will basically give me A, B, C. 42 00:03:39,350 --> 00:03:39,880 Correct. 43 00:03:40,460 --> 00:03:47,060 So I want to do the same thing and just copying it with control C and control V to based. 44 00:03:48,310 --> 00:03:53,960 Basting a three year and here I'm going to take four to seven. 45 00:03:54,520 --> 00:03:59,180 All right, so just a quick reminder, we're starting the count from zero. 46 00:03:59,200 --> 00:04:00,910 So this is one to zero count. 47 00:04:01,330 --> 00:04:04,840 This one is one and this one is two. 48 00:04:05,230 --> 00:04:06,610 And this one is three. 49 00:04:07,090 --> 00:04:07,530 Wow. 50 00:04:07,540 --> 00:04:08,850 Three is not counted. 51 00:04:08,860 --> 00:04:15,130 We talked about it in the previous lecture that you have the range here and the last number is not counted. 52 00:04:15,140 --> 00:04:18,400 So basically you take from zero to three without the three. 53 00:04:19,270 --> 00:04:25,330 So we have zero to three without the three zero one and two. 54 00:04:25,930 --> 00:04:34,330 And then we want to skip the minus and start off from force of this one is four, five and six. 55 00:04:35,830 --> 00:04:43,150 All right, and this one is seven, so we have four to seven without the seven, same as the same as 56 00:04:43,150 --> 00:04:46,390 we did in as we did in here. 57 00:04:46,720 --> 00:04:47,230 All right. 58 00:04:47,230 --> 00:04:48,420 And so on and so on. 59 00:04:48,790 --> 00:04:52,030 So here it will be a 211. 60 00:04:53,620 --> 00:04:57,310 And here it's going to be a 12 to 15. 61 00:04:58,530 --> 00:05:06,920 And now this just for verification, let's just try to print them, all right, we print the first one. 62 00:05:07,500 --> 00:05:10,170 I'm always going to mention the small tips, even if it's annoying. 63 00:05:10,170 --> 00:05:16,950 Guys, for those of you that don't remember, I still once you try typing, you have this pop up and 64 00:05:16,950 --> 00:05:20,700 you have all the options, you don't need to manually type everything. 65 00:05:21,450 --> 00:05:26,940 So, for example, now I want you to print the new partial variable B, so I have it right here. 66 00:05:27,180 --> 00:05:28,810 I just hit enter boom. 67 00:05:28,830 --> 00:05:29,460 So it's you. 68 00:05:32,040 --> 00:05:37,470 And now I'm going to do it for C and I'm going to do it for. 69 00:05:38,920 --> 00:05:39,230 D.. 70 00:05:39,850 --> 00:05:45,450 All right, so for now, let's just try to verify that what we did here in part two is correct. 71 00:05:49,400 --> 00:05:51,960 All right, so great, we have what we wanted. 72 00:05:51,980 --> 00:05:56,440 We have ABCDE, Faggotry and Jayco and exactly what we wanted. 73 00:05:56,780 --> 00:06:04,330 All right, so we broke down the four parts of this year number exactly like and we wanted to do in 74 00:06:04,340 --> 00:06:05,030 part two. 75 00:06:05,420 --> 00:06:07,730 And let's head up for part three. 76 00:06:08,600 --> 00:06:12,830 So in part, were you what we were needed to do is to. 77 00:06:13,800 --> 00:06:17,160 Replace values with new ones. 78 00:06:18,570 --> 00:06:20,760 Using replace. 79 00:06:21,480 --> 00:06:27,480 All right, so this is the name of the action that we have studied in the previous lecture. 80 00:06:27,910 --> 00:06:29,730 Oh, I missed here the number. 81 00:06:31,110 --> 00:06:32,590 And capital. 82 00:06:32,730 --> 00:06:43,560 All right, so let's just do let's just take the the variables ABCDE all right. 83 00:06:43,560 --> 00:06:46,490 From here, I'll just copy copy them manually. 84 00:06:47,010 --> 00:06:47,880 So we have a. 85 00:06:49,280 --> 00:06:50,380 Now we have the. 86 00:06:55,780 --> 00:06:56,620 S.. 87 00:07:03,020 --> 00:07:11,900 And so because, you know, I'm copying them altogether, because it's the same action up on each and 88 00:07:11,900 --> 00:07:12,660 every one of them. 89 00:07:12,680 --> 00:07:17,510 So once we figure out how to do it, the first one, always the same thing for the other ones as well. 90 00:07:17,990 --> 00:07:24,570 So what we want to do actually, guys, is to replace the the values. 91 00:07:24,740 --> 00:07:26,100 So how do we do it? 92 00:07:26,120 --> 00:07:27,020 It's really easy. 93 00:07:27,050 --> 00:07:31,820 Think of it as a logically, we just take the existing value. 94 00:07:32,360 --> 00:07:32,950 All right. 95 00:07:33,470 --> 00:07:36,950 We take the existing this one and this one are the same. 96 00:07:36,960 --> 00:07:37,300 Right. 97 00:07:37,910 --> 00:07:40,830 But here we declared a new variable. 98 00:07:40,970 --> 00:07:45,790 This is one is a new variable is same is in math that you write, for example. 99 00:07:45,800 --> 00:07:47,120 This is just an example, right? 100 00:07:47,710 --> 00:07:52,860 Same as in math that you write like X is five plus three. 101 00:07:52,880 --> 00:07:53,240 All right. 102 00:07:53,430 --> 00:07:55,520 So you declare a variable. 103 00:07:56,680 --> 00:08:04,240 And you put a value to it, so the left side is always a declaration and the right side is always the 104 00:08:04,240 --> 00:08:07,270 value that you put inside the variable. 105 00:08:07,690 --> 00:08:08,800 This is very important. 106 00:08:08,830 --> 00:08:09,180 All right. 107 00:08:09,500 --> 00:08:14,080 You can get your life really easy regarding these street variables. 108 00:08:14,780 --> 00:08:16,960 So this is the variable that I have. 109 00:08:16,960 --> 00:08:19,820 And now on the right side, I'm going to put the value to it. 110 00:08:20,050 --> 00:08:22,410 So what value do I wanted to put in it? 111 00:08:22,420 --> 00:08:26,800 So I'm just going to hit it that they replace. 112 00:08:27,190 --> 00:08:31,990 And then as I recall, we needed to take the ABC. 113 00:08:32,860 --> 00:08:39,190 Right, because this is what we have in new partial variable and replace it with AAA. 114 00:08:39,400 --> 00:08:39,790 Right. 115 00:08:41,470 --> 00:08:46,320 And we wanted to do the same with the second one. 116 00:08:46,370 --> 00:08:47,980 Let's just choose B here. 117 00:08:49,130 --> 00:08:49,850 Don't be. 118 00:08:51,800 --> 00:08:57,890 And that's replace and single quote and then. 119 00:08:59,630 --> 00:09:06,140 Replace the DSF with baby. 120 00:09:06,890 --> 00:09:10,970 Oh, I've missed the single quote, maybe be all right. 121 00:09:12,530 --> 00:09:20,570 Thirty one new partial C that's in place, then we have GHC. 122 00:09:22,440 --> 00:09:31,920 And right after the coma and quoting Mark, we have a coma and then another clotting and C.C.C. and 123 00:09:31,920 --> 00:09:40,320 the last one knew partial these dots place and we want to replace the J. 124 00:09:40,320 --> 00:09:41,220 K l. 125 00:09:42,910 --> 00:09:53,590 Coma with the the the correct just to verify the step, let's let us just print it again. 126 00:09:53,920 --> 00:09:54,830 So. 127 00:09:55,980 --> 00:09:59,000 So, guys, the program runs from top to bottom. 128 00:09:59,480 --> 00:10:09,940 OK, so here we declared the new partial a variable here we printed it, but here we declared a new 129 00:10:09,940 --> 00:10:11,020 value to it. 130 00:10:11,030 --> 00:10:18,140 So once once the program runs from top to bottom and it got to this point right here. 131 00:10:18,730 --> 00:10:24,550 So we have inserted a new value into a new partial variable, new partial variable. 132 00:10:24,550 --> 00:10:26,040 A has a new value now. 133 00:10:26,440 --> 00:10:33,580 So the print over here is going to print ABC, but once we print again here. 134 00:10:36,180 --> 00:10:44,130 He's going to print AAA because this line indicates that new partial variable A has a new value inside 135 00:10:44,130 --> 00:10:44,270 it. 136 00:10:44,280 --> 00:10:48,630 So it's going to print AAA according to what we wrote here. 137 00:10:49,500 --> 00:10:50,070 All right. 138 00:10:50,070 --> 00:10:53,270 So so I'm just going to copy all of these. 139 00:10:53,280 --> 00:10:53,730 All right. 140 00:10:53,730 --> 00:10:59,850 Because it's the same command, the same variables, but different values to the variable. 141 00:10:59,850 --> 00:11:00,930 So it's very important. 142 00:11:01,950 --> 00:11:02,540 All right. 143 00:11:02,940 --> 00:11:05,130 So let us just verify it and. 144 00:11:05,130 --> 00:11:05,610 Right. 145 00:11:05,610 --> 00:11:07,620 Click and run. 146 00:11:10,210 --> 00:11:17,950 All right, so we have A, B, C, D, E, F, G, G, Chai and Jakiel from the previous from like a 147 00:11:17,980 --> 00:11:25,490 step two part to and from part three, we have AAA, BBB, CCC and DVD. 148 00:11:25,930 --> 00:11:28,750 This is exactly what we wanted to achieve. 149 00:11:28,990 --> 00:11:37,420 We use here the replace action and we replaced the current value inside it with what we wanted right 150 00:11:37,420 --> 00:11:38,630 here on the right side. 151 00:11:39,640 --> 00:11:43,630 So we're down to part four. 152 00:11:46,640 --> 00:11:54,020 And in part four, we wanted to create a new serial number. 153 00:11:55,410 --> 00:11:57,900 Out of the new. 154 00:11:58,800 --> 00:12:03,120 But sorry, partial partial ones. 155 00:12:03,150 --> 00:12:05,040 All right, we wanted to take. 156 00:12:05,280 --> 00:12:10,050 Sorry, guys, we wanted to take these four variables and we wanted to create a new one. 157 00:12:11,040 --> 00:12:16,530 So we were asked to call the variable and encoded. 158 00:12:18,430 --> 00:12:21,100 Windows serial number. 159 00:12:22,350 --> 00:12:27,360 And how can we actually combine these four? 160 00:12:27,750 --> 00:12:28,920 It's really simple. 161 00:12:30,370 --> 00:12:38,230 We'll just take the first one and then use plus so it's not a mathematical action, we're not going 162 00:12:38,230 --> 00:12:49,060 to combine AAA and plus BBB, it's not going to give a mathematical result because this plus sign is 163 00:12:49,060 --> 00:12:50,200 upon a string. 164 00:12:50,440 --> 00:12:50,790 All right. 165 00:12:50,800 --> 00:12:53,230 Well, we're dealing with string values here. 166 00:12:54,130 --> 00:12:54,580 All right. 167 00:12:54,580 --> 00:12:56,430 We're dealing with string values here. 168 00:12:56,710 --> 00:13:05,380 So this action will actually just stick them together because you can't really do a plus sign upon letters 169 00:13:05,620 --> 00:13:13,390 or it doesn't matter if even if you had, like, numbers here, you can do a plus plus assign upon string 170 00:13:13,390 --> 00:13:15,650 values because it's not possible. 171 00:13:15,670 --> 00:13:17,820 So this is just going to stick them together. 172 00:13:19,030 --> 00:13:25,090 So I'm just going to double click the new partial variable B and control V to base it here. 173 00:13:25,690 --> 00:13:35,840 Another plus control C to copy control V and another plus and print it. 174 00:13:36,520 --> 00:13:40,810 So let's just print it and just copy it. 175 00:13:41,210 --> 00:13:42,370 Double click control. 176 00:13:42,370 --> 00:13:42,880 See. 177 00:13:45,290 --> 00:13:53,150 And print, enter and control V to paste it as just right, click and run. 178 00:13:54,350 --> 00:14:00,020 All right, so we have the serial number right here, but we have a slight problem because the original 179 00:14:00,290 --> 00:14:03,950 the original serial number had like minus signs between them. 180 00:14:04,220 --> 00:14:07,020 And we've been over this in the previous lectures. 181 00:14:07,040 --> 00:14:13,260 So what we're going to do is just insert another plus here. 182 00:14:14,180 --> 00:14:14,580 All right. 183 00:14:14,600 --> 00:14:15,610 We have a look. 184 00:14:15,620 --> 00:14:18,530 I just wanted you to go into the details. 185 00:14:18,720 --> 00:14:20,320 We have the first one right here. 186 00:14:20,480 --> 00:14:22,060 We had the second one right here. 187 00:14:22,190 --> 00:14:24,030 And between then, we have a plus. 188 00:14:24,260 --> 00:14:32,810 So what we want to do is to add another plus here and then add quoting Marx and then add a space between 189 00:14:32,810 --> 00:14:33,140 them. 190 00:14:33,450 --> 00:14:35,870 And actually, we don't need a space. 191 00:14:35,870 --> 00:14:41,480 We need a minus sign between them because we want the new serial number to look like this with a minus 192 00:14:41,480 --> 00:14:42,920 sign between each part. 193 00:14:44,240 --> 00:14:50,420 So what we got here, we have the first part and then we have a plus with a minus and then we have the 194 00:14:50,420 --> 00:14:51,670 second part and so on. 195 00:14:51,950 --> 00:14:54,750 So let's do it here as well. 196 00:14:54,950 --> 00:14:55,610 Plus. 197 00:14:57,510 --> 00:15:06,090 Quoting Marks and minus and here as well, plus quoting Marx and Mind and minus, so right, click on 198 00:15:06,090 --> 00:15:07,470 the file and run it. 199 00:15:08,310 --> 00:15:10,410 Whoa, guys, you see it. 200 00:15:10,420 --> 00:15:12,330 We have exactly what we wanted. 201 00:15:12,870 --> 00:15:15,000 And Part five was. 202 00:15:17,870 --> 00:15:20,360 Print the serial number. 203 00:15:21,310 --> 00:15:33,310 Along with plain text, so this one is pretty easy, just add the quoting marks and state and encoded 204 00:15:33,310 --> 00:15:34,750 serial number. 205 00:15:35,970 --> 00:15:45,870 Ahead and then another space and after the quoting marks, just add the plus sign and take this very 206 00:15:46,110 --> 00:15:52,050 this final variable that we have copied and pasted here and let's print it. 207 00:15:54,650 --> 00:15:59,860 So there we have it, we have the final serial number that we wanted after we manipulated it. 208 00:16:00,110 --> 00:16:02,190 So let's have a quick look what we did here. 209 00:16:02,420 --> 00:16:10,940 We've taken a base serial on the serial number, and afterwards we first declared variables A, B, 210 00:16:10,940 --> 00:16:12,650 C and D, partial ones. 211 00:16:13,100 --> 00:16:15,950 And we've put these values inside them. 212 00:16:15,950 --> 00:16:24,190 We've taken the original serial number and we have just extracted values zero to three into it. 213 00:16:24,440 --> 00:16:30,320 And same here a and here just printed it afterwards for verification. 214 00:16:30,890 --> 00:16:34,520 Then we've taken these four variables right here. 215 00:16:34,520 --> 00:16:38,690 We declare them again and we have changed the value which is inside them. 216 00:16:38,870 --> 00:16:46,520 We've taken the same value and we applied to replace action upon them, change the value inside from 217 00:16:46,520 --> 00:16:49,630 this value to that one and the same for all of them. 218 00:16:50,630 --> 00:16:54,740 Then we printed it quickly to see what we have inside, just to verify it. 219 00:16:55,520 --> 00:17:03,200 Afterwards, we combine the four parts altogether and added a minus sign between them in order for the 220 00:17:03,200 --> 00:17:05,120 new serial number to look like this. 221 00:17:06,740 --> 00:17:14,500 And the last part was just to add plain text here and afterwards sprint the new serial number. 222 00:17:15,260 --> 00:17:18,990 So guys, we finish to practice string variables. 223 00:17:19,160 --> 00:17:20,370 This was amazing. 224 00:17:20,390 --> 00:17:26,560 I think dominant dominating the string variable if we got until this part. 225 00:17:27,170 --> 00:17:34,180 Don't be scared if it wasn't very easy for you because it was indeed a challenging assignment. 226 00:17:34,550 --> 00:17:38,120 So I just want you to understand what we have done. 227 00:17:38,390 --> 00:17:42,080 And this is the important part to understand what we are doing. 228 00:17:42,380 --> 00:17:47,840 And even if you didn't do everything by yourself, even if you did some parts, it's all right. 229 00:17:48,050 --> 00:17:50,060 We're in a learning process. 230 00:17:50,210 --> 00:17:55,370 And don't worry, we're going to practice the shrink variables and again and again in the future as 231 00:17:55,370 --> 00:17:55,730 well. 232 00:17:56,460 --> 00:18:04,250 And I recommend that after this lesson, the homework lesson, just try to play with these variables. 233 00:18:04,250 --> 00:18:07,490 Just for example, just for I'm just just an example. 234 00:18:08,210 --> 00:18:15,670 Just changes from AAA to AA and just printed again just like that. 235 00:18:15,680 --> 00:18:15,980 Right. 236 00:18:16,000 --> 00:18:22,850 So, for example, we have printed the V.A. We see it here and afterwards we can see it also in here. 237 00:18:23,930 --> 00:18:28,070 Just do some do some tricks on the cold, as you can see right here. 238 00:18:28,400 --> 00:18:34,700 And also this file is attached to the lecture, so you can just copy it. 239 00:18:34,700 --> 00:18:36,080 It's a plain text file. 240 00:18:36,320 --> 00:18:39,050 You can just copy it into your polytrauma and use it. 241 00:18:39,350 --> 00:18:46,070 And just don't be afraid to change values here and just to get the hang of it deeper as much as you 242 00:18:46,070 --> 00:18:46,400 can. 243 00:18:47,210 --> 00:18:48,850 All right, guys, thank you. 244 00:18:48,920 --> 00:18:50,930 And I will see you in the next lecture.