Welcome.
And this video will resolve last videos assignments, which analysts practice advanced.
So, first of all, let's great a new file that's got collections, lists, practice
advanced.
All right, so let's leave a note also, collections lists practice.
That's great.
So first of all, I well, I asked you guys to create an employee employee's list.
Creative employees, less so let's just declare it.
Like this and state, the employees are here, so we have John Roberts or Adam or John.
Yeah, like this.
And let's not forget about the women we have, Dana and Ashley.
Correct.
Great.
So, first of all, I asked you guys in the first assignment, just going to mention here the number
of those times women.
So we don't get mixed once we print all of them.
So first of all, I asked you guys to print the list simply, is that so?
Casting their employees and it's printed just to make sure.
All right.
So we have the list right here.
Then I wanted you guys to print the length of the list.
So first of all, we have the list.
OK, so anybody remember the key word?
You print out the length of the list.
We went over this in previous practice videos.
So the key word, these is length.
So this will give us the length of the list.
So all around it, let's get the print action like this and let's also give a string and indicative
string example.
The length of the list is and this is assignment number two.
Correct.
Like this.
And here closing quotation marks and plus.
And I also want to show you a cool trick.
You see that bit from having, like, weird brown background here on the lank employees.
So I'm just going to click it once and then hover.
And you see it states here that he has some kind of problem expects type string, but got an end.
And why is that?
Let's think and we have this message because lank states the length of the list and this is actually
a string.
But as we discussed many times, when we try to print something so by Trump does not like having two
types of dots us inside the print.
So we have a string and also have you anent.
So that's not OK.
So let's also cover it with a casting of string like this.
And now we don't have any issues.
We don't have the shady background behind the employees.
Let's print it.
Great.
So we have the length printed out here.
Just want to mention an important thing we already discussed, but it's worth mentioning.
Remember this thing, guys.
All right.
So we have the indexes.
All right.
We already discussed index and why it is so index of the list.
This one is index zero, this index one, index two and three and index four.
So in total, the last index we have is for this is regarding indexes and in a different topic once
we talk about the length.
All right.
So the length starts its count down from one.
And that's why you see here five and not for it starts from one.
So we have one, two, three, four and five.
So once discussing the length, it starts from one, once discussing the index, it starts from zero.
You have to differentiate, differentiate between the two of these.
Great.
So let's head over to the next assignment once.
Jack sorry.
John left, Jack took its place.
So let's use the let's, first of all, declare a mansion, so that's the mentioned the list and then
choose the index that we would like to change.
So once applying it with square brackets, with a number of the index and then after equals, we put
the new value, this will run over the value here and put the new value instead of it.
Jack added, instead of John, and this one was assignment number three.
All right.
And here in the casting staff sorry, staff and then employees enter and I sprinted.
OK, so we had we had John and I, we have Jack here, so this is great.
This is exactly what we wanted.
All right.
So let's go over to the next assignment.
So now we have a new employee, right?
And the company, LAT's added.
That's added to in the extreme, but this time we have to remember not to run over zero one, two,
three, not to run over Dana.
We want to add maverick.
All right.
New employee in the company, Maverick.
Let's add it to industry without moving, Dana.
So we have to be careful not to remove Dana.
We don't want to upset her.
All right.
So that's the maverick and we can do it.
You know what lot before that.
Let's just head out to the action itself.
So we have employee then.
Then we have the insert key, key, key action key.
And then we choose the.
All right, let's put the comma first and then we choose the left, the cell that we want to answer
to and then the value to the right.
So what will happen is whoever is on cell number three will move over and Maverick will go instead.
That sprint, it added Maverick.
To sell three, and this is assignment number four.
So SDR employee and Toura and let's run it.
All right, so you seize this index zero, index one and X2 and index three, so on index three, we
have Maverick and then moved over to the right.
This is exactly what we wanted because we didn't want to remove Dana from the list.
Great.
OK, and that's headed over to the next assignment, which is remove Maverick
and add him to the end of the list.
Using a band, you don't have to use a band that you can also use the insert as well because it's the
same thing.
But I chose to use a band.
So first of all, we would like to remove him completely.
So we have employees that and then we have the action remove and let's state here that it's maverick
and the quotation marks and then print.
So this assignment was five a not mistaken and then remove Maverick from the list.
All right.
I'm sorry.
Like this that sprint it and see that it has been removed so well.
All right.
So Maverick has been removed.
By the way, guys, if you get into trouble with these assignments, just look over to the presentation
attached to the previous lecture or just watched the previous lecture and you would see all of this
all of these key action keys mentioned there.
OK, so now we removed the maverick from the list and we don't see him anymore.
And then what we wanted to do is to add Maverick to.
Index three, same as we did before.
All right, so employees that insert three.
Oh, sorry, I just got a mistake here at Maverick to the end of the list, correct.
So it's not insert, it's not a band.
OK, and then we want to add Maverick to the end.
All right.
Like this.
So a band action.
We all went over in the previous practice video, which was the bonus assignment, and we can now see
it here as well.
So that's Brent Maverick first.
First of all, I need to put to you that this is 5V and Maverick.
Add it to the end of the list.
OK, this SDR and employee's printed great.
So Mattrick, first of all, he was here then he was remove the tile and then he was added to the end
of the list.
In what way we can use to add Maverick to the end of the list beside the fact we can also use employees
and use the insert.
Right.
So we have Maverick here.
And what cell number should we use?
Let's see.
So we have here five.
A five, a maverick was removed.
All right.
So now we want to add them to the end of the list of this list after he was removed.
So this one is index zero.
One, two, three, four.
And actually, we want to add it to index number five right after Ashely.
So that's, what, five here and run it.
So again, you see, Maverick was added right here.
So basically for this assignment and for other assignments as well, you have several solutions for
this assignment.
You can use this aband action or the insert action by stating that you want to inserted into index five.
All right.
And let's head over to the next one.
And we would like to remove the battery from the team.
He was making trouble, remove Patrick and not Patrick Maverick.
Remove Maverick from the employee's.
List because he did some trouble and then we have employees, Pop
and Maverick inside the BOP.
Oh, we don't even need to mention because if you recall, Pop removes the last item of the list.
So all that sprint, this is the sixth assignment.
Remove Patrick.
Maverick oh.
I have a friendly battery, so I always saying, Maverick, my mistake, a move maverick from the list.
And employees, great, so we have removed them using pop again, pop removes the last item of the list
and I sprinted, so he was removed.
By the way, can anyone say if I stayed here, I can also stay here than the number of the cell?
OK, let's do an example.
Just stating here zero.
And we should see that Adam would be removed after we run it.
OK, so Adam was removed.
OK, so anyone can tell me if I put here minus one.
What minus one states for we've seen it in the theory part of BASIX and lists.
So if I put here minus one, what will happen.
OK, so Maverick was removed as well, because if you remember once you use the minus one regarding
list, it addresses the last item of the list that I sell.
So basically not mentioning it, mentioning here anything or mentioning minus one is the same.
All right, I'll leave here the minus one just to stay, just to show that you can use any number here
to remove any cell that you want.
All right.
So now we came up to the bonus.
All right.
We have the bonus.
Simon, sort the list by ABC.
So let's try to do it together, OK?
So fight on short list.
All right.
So just picking a website here and the results and I can see here that by default, so it doesn't require
any parameter.
So we can see here the sort action and we can see here an example of the list.
And this one is assort.
So let's try to use this one.
All right.
So let's try the employees that sort of like this and try to print sorted lists like this
and employees and casting staff like this.
All right.
There you have it.
So it is sorted by ABC, this one, A, the G and J.
All right.
So we have just encountered of searching online for something that we need and for example, this sort
action and this one was really easy to find.
Basically, I just picked up the first result was searching for the phrase, before we finish, I just
want to state that we use this website and also mention here all all rights reserved
to.
All right.
This website that we've taken this example from.
But you see, it's pretty easy.
Just look it up in the Internet using simple phrases as you can and you can find it, find it easily.
So this sort actually practices how actual developers work.
So once they get an assignment, they don't know what to do.
They can ask their friends, but also they can look it up in the Internet and find it instantly.
It's not very hard.
Just copy paste it.
And usually if the things is simple, it works.
And that's about it, guys.
So we have finished the advanced practice regarding lists and see you in the next video.