1 00:00:10,210 --> 00:00:10,910 Welcome. 2 00:00:10,960 --> 00:00:17,000 And this video will resolve last videos assignments, which analysts practice advanced. 3 00:00:17,300 --> 00:00:23,680 So, first of all, let's great a new file that's got collections, lists, practice 4 00:00:26,380 --> 00:00:27,190 advanced. 5 00:00:31,010 --> 00:00:38,870 All right, so let's leave a note also, collections lists practice. 6 00:00:42,310 --> 00:00:43,650 That's great. 7 00:00:44,120 --> 00:00:50,330 So first of all, I well, I asked you guys to create an employee employee's list. 8 00:00:54,560 --> 00:00:58,760 Creative employees, less so let's just declare it. 9 00:01:01,060 --> 00:01:11,400 Like this and state, the employees are here, so we have John Roberts or Adam or John. 10 00:01:11,650 --> 00:01:12,670 Yeah, like this. 11 00:01:15,910 --> 00:01:20,560 And let's not forget about the women we have, Dana and Ashley. 12 00:01:20,890 --> 00:01:21,480 Correct. 13 00:01:22,360 --> 00:01:22,750 Great. 14 00:01:22,780 --> 00:01:27,430 So, first of all, I asked you guys in the first assignment, just going to mention here the number 15 00:01:27,430 --> 00:01:28,050 of those times women. 16 00:01:28,060 --> 00:01:31,250 So we don't get mixed once we print all of them. 17 00:01:31,570 --> 00:01:37,210 So first of all, I asked you guys to print the list simply, is that so? 18 00:01:37,210 --> 00:01:43,030 Casting their employees and it's printed just to make sure. 19 00:01:43,980 --> 00:01:44,580 All right. 20 00:01:45,490 --> 00:01:45,770 All right. 21 00:01:45,820 --> 00:01:47,120 So we have the list right here. 22 00:01:47,830 --> 00:01:54,360 Then I wanted you guys to print the length of the list. 23 00:01:54,790 --> 00:01:57,940 So first of all, we have the list. 24 00:01:58,150 --> 00:02:00,970 OK, so anybody remember the key word? 25 00:02:01,190 --> 00:02:02,730 You print out the length of the list. 26 00:02:02,740 --> 00:02:05,110 We went over this in previous practice videos. 27 00:02:05,620 --> 00:02:09,060 So the key word, these is length. 28 00:02:10,270 --> 00:02:14,080 So this will give us the length of the list. 29 00:02:14,500 --> 00:02:23,050 So all around it, let's get the print action like this and let's also give a string and indicative 30 00:02:23,230 --> 00:02:24,570 string example. 31 00:02:24,640 --> 00:02:30,070 The length of the list is and this is assignment number two. 32 00:02:30,070 --> 00:02:30,610 Correct. 33 00:02:31,210 --> 00:02:31,930 Like this. 34 00:02:32,320 --> 00:02:35,110 And here closing quotation marks and plus. 35 00:02:35,710 --> 00:02:37,510 And I also want to show you a cool trick. 36 00:02:37,720 --> 00:02:45,010 You see that bit from having, like, weird brown background here on the lank employees. 37 00:02:45,190 --> 00:02:47,140 So I'm just going to click it once and then hover. 38 00:02:47,560 --> 00:02:54,220 And you see it states here that he has some kind of problem expects type string, but got an end. 39 00:02:55,010 --> 00:02:55,860 And why is that? 40 00:02:55,960 --> 00:03:03,550 Let's think and we have this message because lank states the length of the list and this is actually 41 00:03:03,910 --> 00:03:04,650 a string. 42 00:03:04,870 --> 00:03:11,710 But as we discussed many times, when we try to print something so by Trump does not like having two 43 00:03:11,710 --> 00:03:14,040 types of dots us inside the print. 44 00:03:14,050 --> 00:03:18,070 So we have a string and also have you anent. 45 00:03:18,340 --> 00:03:19,350 So that's not OK. 46 00:03:19,360 --> 00:03:24,190 So let's also cover it with a casting of string like this. 47 00:03:25,000 --> 00:03:27,760 And now we don't have any issues. 48 00:03:27,760 --> 00:03:33,310 We don't have the shady background behind the employees. 49 00:03:34,360 --> 00:03:35,080 Let's print it. 50 00:03:37,240 --> 00:03:37,660 Great. 51 00:03:37,660 --> 00:03:39,520 So we have the length printed out here. 52 00:03:39,910 --> 00:03:44,510 Just want to mention an important thing we already discussed, but it's worth mentioning. 53 00:03:45,100 --> 00:03:47,020 Remember this thing, guys. 54 00:03:47,890 --> 00:03:48,250 All right. 55 00:03:48,250 --> 00:03:50,290 So we have the indexes. 56 00:03:50,290 --> 00:03:50,610 All right. 57 00:03:50,650 --> 00:03:54,450 We already discussed index and why it is so index of the list. 58 00:03:54,580 --> 00:03:59,440 This one is index zero, this index one, index two and three and index four. 59 00:03:59,680 --> 00:04:07,180 So in total, the last index we have is for this is regarding indexes and in a different topic once 60 00:04:07,180 --> 00:04:08,780 we talk about the length. 61 00:04:09,250 --> 00:04:09,850 All right. 62 00:04:10,060 --> 00:04:13,060 So the length starts its count down from one. 63 00:04:13,330 --> 00:04:17,020 And that's why you see here five and not for it starts from one. 64 00:04:17,020 --> 00:04:20,450 So we have one, two, three, four and five. 65 00:04:21,340 --> 00:04:27,760 So once discussing the length, it starts from one, once discussing the index, it starts from zero. 66 00:04:27,790 --> 00:04:31,150 You have to differentiate, differentiate between the two of these. 67 00:04:32,260 --> 00:04:32,520 Great. 68 00:04:32,560 --> 00:04:35,800 So let's head over to the next assignment once. 69 00:04:36,400 --> 00:04:37,480 Jack sorry. 70 00:04:37,480 --> 00:04:44,920 John left, Jack took its place. 71 00:04:47,710 --> 00:04:57,250 So let's use the let's, first of all, declare a mansion, so that's the mentioned the list and then 72 00:04:57,520 --> 00:04:59,780 choose the index that we would like to change. 73 00:05:00,130 --> 00:05:06,790 So once applying it with square brackets, with a number of the index and then after equals, we put 74 00:05:06,790 --> 00:05:12,070 the new value, this will run over the value here and put the new value instead of it. 75 00:05:16,620 --> 00:05:25,860 Jack added, instead of John, and this one was assignment number three. 76 00:05:27,720 --> 00:05:28,510 All right. 77 00:05:28,520 --> 00:05:36,840 And here in the casting staff sorry, staff and then employees enter and I sprinted. 78 00:05:39,510 --> 00:05:45,730 OK, so we had we had John and I, we have Jack here, so this is great. 79 00:05:45,740 --> 00:05:47,210 This is exactly what we wanted. 80 00:05:48,050 --> 00:05:48,620 All right. 81 00:05:48,620 --> 00:05:50,900 So let's go over to the next assignment. 82 00:05:50,930 --> 00:05:53,090 So now we have a new employee, right? 83 00:05:56,770 --> 00:06:00,730 And the company, LAT's added. 84 00:06:03,840 --> 00:06:14,670 That's added to in the extreme, but this time we have to remember not to run over zero one, two, 85 00:06:14,670 --> 00:06:16,810 three, not to run over Dana. 86 00:06:16,830 --> 00:06:18,360 We want to add maverick. 87 00:06:18,810 --> 00:06:19,380 All right. 88 00:06:19,920 --> 00:06:23,670 New employee in the company, Maverick. 89 00:06:24,750 --> 00:06:30,320 Let's add it to industry without moving, Dana. 90 00:06:31,110 --> 00:06:34,300 So we have to be careful not to remove Dana. 91 00:06:34,410 --> 00:06:35,790 We don't want to upset her. 92 00:06:36,540 --> 00:06:37,110 All right. 93 00:06:37,110 --> 00:06:41,040 So that's the maverick and we can do it. 94 00:06:41,340 --> 00:06:42,540 You know what lot before that. 95 00:06:42,840 --> 00:06:45,690 Let's just head out to the action itself. 96 00:06:45,690 --> 00:06:48,930 So we have employee then. 97 00:06:49,260 --> 00:06:52,350 Then we have the insert key, key, key action key. 98 00:06:52,710 --> 00:06:54,870 And then we choose the. 99 00:06:55,410 --> 00:07:00,660 All right, let's put the comma first and then we choose the left, the cell that we want to answer 100 00:07:00,660 --> 00:07:03,310 to and then the value to the right. 101 00:07:03,600 --> 00:07:11,670 So what will happen is whoever is on cell number three will move over and Maverick will go instead. 102 00:07:12,120 --> 00:07:15,990 That sprint, it added Maverick. 103 00:07:19,500 --> 00:07:25,500 To sell three, and this is assignment number four. 104 00:07:28,560 --> 00:07:32,340 So SDR employee and Toura and let's run it. 105 00:07:34,360 --> 00:07:40,880 All right, so you seize this index zero, index one and X2 and index three, so on index three, we 106 00:07:40,880 --> 00:07:43,580 have Maverick and then moved over to the right. 107 00:07:43,910 --> 00:07:48,020 This is exactly what we wanted because we didn't want to remove Dana from the list. 108 00:07:48,860 --> 00:07:49,460 Great. 109 00:07:49,870 --> 00:07:57,350 OK, and that's headed over to the next assignment, which is remove Maverick 110 00:08:00,950 --> 00:08:05,660 and add him to the end of the list. 111 00:08:06,080 --> 00:08:15,110 Using a band, you don't have to use a band that you can also use the insert as well because it's the 112 00:08:15,110 --> 00:08:15,830 same thing. 113 00:08:16,280 --> 00:08:18,530 But I chose to use a band. 114 00:08:18,860 --> 00:08:23,930 So first of all, we would like to remove him completely. 115 00:08:24,770 --> 00:08:32,480 So we have employees that and then we have the action remove and let's state here that it's maverick 116 00:08:33,290 --> 00:08:36,390 and the quotation marks and then print. 117 00:08:37,340 --> 00:08:47,900 So this assignment was five a not mistaken and then remove Maverick from the list. 118 00:08:49,460 --> 00:08:50,030 All right. 119 00:08:50,100 --> 00:08:50,780 I'm sorry. 120 00:08:52,700 --> 00:08:58,970 Like this that sprint it and see that it has been removed so well. 121 00:08:58,970 --> 00:08:59,190 All right. 122 00:08:59,210 --> 00:09:00,830 So Maverick has been removed. 123 00:09:01,070 --> 00:09:06,680 By the way, guys, if you get into trouble with these assignments, just look over to the presentation 124 00:09:06,680 --> 00:09:12,890 attached to the previous lecture or just watched the previous lecture and you would see all of this 125 00:09:13,040 --> 00:09:15,950 all of these key action keys mentioned there. 126 00:09:16,430 --> 00:09:23,030 OK, so now we removed the maverick from the list and we don't see him anymore. 127 00:09:23,390 --> 00:09:30,560 And then what we wanted to do is to add Maverick to. 128 00:09:33,660 --> 00:09:38,370 Index three, same as we did before. 129 00:09:39,540 --> 00:09:45,270 All right, so employees that insert three. 130 00:09:47,860 --> 00:09:55,570 Oh, sorry, I just got a mistake here at Maverick to the end of the list, correct. 131 00:09:56,200 --> 00:09:59,910 So it's not insert, it's not a band. 132 00:10:00,390 --> 00:10:04,630 OK, and then we want to add Maverick to the end. 133 00:10:05,760 --> 00:10:06,330 All right. 134 00:10:06,340 --> 00:10:06,780 Like this. 135 00:10:06,790 --> 00:10:07,810 So a band action. 136 00:10:07,810 --> 00:10:14,840 We all went over in the previous practice video, which was the bonus assignment, and we can now see 137 00:10:14,840 --> 00:10:15,870 it here as well. 138 00:10:16,150 --> 00:10:19,930 So that's Brent Maverick first. 139 00:10:20,190 --> 00:10:26,440 First of all, I need to put to you that this is 5V and Maverick. 140 00:10:31,350 --> 00:10:33,690 Add it to the end of the list. 141 00:10:34,350 --> 00:10:44,430 OK, this SDR and employee's printed great. 142 00:10:44,430 --> 00:10:52,410 So Mattrick, first of all, he was here then he was remove the tile and then he was added to the end 143 00:10:52,410 --> 00:10:52,980 of the list. 144 00:10:53,180 --> 00:11:00,990 In what way we can use to add Maverick to the end of the list beside the fact we can also use employees 145 00:11:02,220 --> 00:11:04,710 and use the insert. 146 00:11:05,670 --> 00:11:06,170 Right. 147 00:11:06,480 --> 00:11:07,950 So we have Maverick here. 148 00:11:08,160 --> 00:11:09,970 And what cell number should we use? 149 00:11:10,080 --> 00:11:10,700 Let's see. 150 00:11:11,130 --> 00:11:13,290 So we have here five. 151 00:11:13,290 --> 00:11:15,870 A five, a maverick was removed. 152 00:11:16,020 --> 00:11:16,490 All right. 153 00:11:16,500 --> 00:11:21,100 So now we want to add them to the end of the list of this list after he was removed. 154 00:11:21,360 --> 00:11:23,280 So this one is index zero. 155 00:11:23,310 --> 00:11:26,250 One, two, three, four. 156 00:11:26,430 --> 00:11:30,660 And actually, we want to add it to index number five right after Ashely. 157 00:11:31,020 --> 00:11:35,380 So that's, what, five here and run it. 158 00:11:36,960 --> 00:11:39,410 So again, you see, Maverick was added right here. 159 00:11:39,600 --> 00:11:46,470 So basically for this assignment and for other assignments as well, you have several solutions for 160 00:11:46,500 --> 00:11:47,190 this assignment. 161 00:11:47,190 --> 00:11:55,380 You can use this aband action or the insert action by stating that you want to inserted into index five. 162 00:11:55,740 --> 00:11:56,250 All right. 163 00:11:56,820 --> 00:11:59,850 And let's head over to the next one. 164 00:12:00,030 --> 00:12:05,190 And we would like to remove the battery from the team. 165 00:12:06,420 --> 00:12:10,980 He was making trouble, remove Patrick and not Patrick Maverick. 166 00:12:11,820 --> 00:12:16,260 Remove Maverick from the employee's. 167 00:12:18,560 --> 00:12:24,980 List because he did some trouble and then we have employees, Pop 168 00:12:27,140 --> 00:12:30,440 and Maverick inside the BOP. 169 00:12:31,420 --> 00:12:38,690 Oh, we don't even need to mention because if you recall, Pop removes the last item of the list. 170 00:12:39,290 --> 00:12:44,390 So all that sprint, this is the sixth assignment. 171 00:12:44,720 --> 00:12:45,950 Remove Patrick. 172 00:12:49,080 --> 00:12:50,520 Maverick oh. 173 00:12:53,600 --> 00:13:01,940 I have a friendly battery, so I always saying, Maverick, my mistake, a move maverick from the list. 174 00:13:07,000 --> 00:13:15,310 And employees, great, so we have removed them using pop again, pop removes the last item of the list 175 00:13:15,670 --> 00:13:19,810 and I sprinted, so he was removed. 176 00:13:19,990 --> 00:13:26,410 By the way, can anyone say if I stayed here, I can also stay here than the number of the cell? 177 00:13:26,440 --> 00:13:27,760 OK, let's do an example. 178 00:13:27,970 --> 00:13:29,860 Just stating here zero. 179 00:13:30,010 --> 00:13:34,210 And we should see that Adam would be removed after we run it. 180 00:13:34,870 --> 00:13:37,100 OK, so Adam was removed. 181 00:13:37,360 --> 00:13:43,060 OK, so anyone can tell me if I put here minus one. 182 00:13:43,720 --> 00:13:50,380 What minus one states for we've seen it in the theory part of BASIX and lists. 183 00:13:51,100 --> 00:13:53,950 So if I put here minus one, what will happen. 184 00:13:55,970 --> 00:14:03,520 OK, so Maverick was removed as well, because if you remember once you use the minus one regarding 185 00:14:03,520 --> 00:14:08,690 list, it addresses the last item of the list that I sell. 186 00:14:08,860 --> 00:14:14,110 So basically not mentioning it, mentioning here anything or mentioning minus one is the same. 187 00:14:14,980 --> 00:14:19,930 All right, I'll leave here the minus one just to stay, just to show that you can use any number here 188 00:14:19,930 --> 00:14:21,490 to remove any cell that you want. 189 00:14:22,390 --> 00:14:23,020 All right. 190 00:14:23,440 --> 00:14:25,840 So now we came up to the bonus. 191 00:14:25,960 --> 00:14:26,480 All right. 192 00:14:26,500 --> 00:14:27,850 We have the bonus. 193 00:14:29,110 --> 00:14:34,790 Simon, sort the list by ABC. 194 00:14:35,140 --> 00:14:38,830 So let's try to do it together, OK? 195 00:14:39,160 --> 00:14:43,690 So fight on short list. 196 00:14:46,240 --> 00:14:47,340 All right. 197 00:14:47,350 --> 00:14:58,930 So just picking a website here and the results and I can see here that by default, so it doesn't require 198 00:14:58,930 --> 00:15:00,180 any parameter. 199 00:15:00,430 --> 00:15:06,640 So we can see here the sort action and we can see here an example of the list. 200 00:15:08,020 --> 00:15:10,030 And this one is assort. 201 00:15:10,450 --> 00:15:13,170 So let's try to use this one. 202 00:15:13,180 --> 00:15:13,640 All right. 203 00:15:13,660 --> 00:15:23,950 So let's try the employees that sort of like this and try to print sorted lists like this 204 00:15:27,520 --> 00:15:36,910 and employees and casting staff like this. 205 00:15:38,120 --> 00:15:38,800 All right. 206 00:15:40,290 --> 00:15:41,200 There you have it. 207 00:15:41,380 --> 00:15:46,510 So it is sorted by ABC, this one, A, the G and J. 208 00:15:47,020 --> 00:15:47,500 All right. 209 00:15:47,510 --> 00:15:56,120 So we have just encountered of searching online for something that we need and for example, this sort 210 00:15:56,140 --> 00:15:59,710 action and this one was really easy to find. 211 00:15:59,740 --> 00:16:06,550 Basically, I just picked up the first result was searching for the phrase, before we finish, I just 212 00:16:06,550 --> 00:16:20,860 want to state that we use this website and also mention here all all rights reserved 213 00:16:23,140 --> 00:16:23,650 to. 214 00:16:24,550 --> 00:16:25,000 All right. 215 00:16:25,030 --> 00:16:28,320 This website that we've taken this example from. 216 00:16:29,200 --> 00:16:30,760 But you see, it's pretty easy. 217 00:16:31,930 --> 00:16:37,700 Just look it up in the Internet using simple phrases as you can and you can find it, find it easily. 218 00:16:37,870 --> 00:16:41,800 So this sort actually practices how actual developers work. 219 00:16:42,010 --> 00:16:44,890 So once they get an assignment, they don't know what to do. 220 00:16:44,890 --> 00:16:49,450 They can ask their friends, but also they can look it up in the Internet and find it instantly. 221 00:16:49,630 --> 00:16:50,650 It's not very hard. 222 00:16:50,860 --> 00:16:52,140 Just copy paste it. 223 00:16:52,240 --> 00:16:55,660 And usually if the things is simple, it works. 224 00:16:55,870 --> 00:16:57,450 And that's about it, guys. 225 00:16:57,640 --> 00:17:04,090 So we have finished the advanced practice regarding lists and see you in the next video.