Welcome to this video now.
We will try to resolve top practice parts and all right, so once you open your projects, create a
new file as always, and you can give it a meaningful name.
For example, collections, double practice, and here also collections type of practice.
Yeah.
So the first assignment you were asked to create a double with double off tech terms.
Yeah.
So let's create it.
It was tech, not loggi, called terms like that and topolice obviously with round brackets.
And we had Python here.
And then picture.
Topal.
Collections and string like that.
Yeah, so let's try to print it.
So this is the first assignment.
This is the Toppo collection and we have a year plus and technological terms like that.
So what we did here basically just create a basic Thorpdale as what we had in the first assignment and
then just print it.
Let's see that we are OK.
Great.
So the top is printed successfully and from here.
Let's go straight forward to the next assignment.
And the second assignment was let's just mark here that this is assignment number one as well.
Yeah, like that.
An assignment number two was to print a sentence using.
Using cell extraction.
Regular, regular and Nygård negative.
Yeah, so because the sentence is a bit long, I have it here on the other screen, so I'm just going
to copy it to the publisher so it will be easier to print it.
So this is the sense, the sentence we have error here.
So we just put the comment Mark before it and we'll be fine.
So let's put it here in the beginning.
Yeah, like that.
So this is the sentence.
We're ninja developers.
We write Python called in by Charmides and now practicing tuple collection stuff that contains a string
of variables.
So we have the words here and that's just try to print it as we were asked by using negative and regular
extraction.
So first of all, let's mark here that this is assignment number two.
And let's begin first of all, we have regular words.
All right.
So we have we are ninja developers, right?
And then we.
We write and then we have the first word, which is we write Python and we marked it as a regular extraction.
So regular extraction, it's this cell and this cell's index in regular extraction is zero.
So let's just extract it.
That's do a plus sign outside.
It's outside the quotation mark because we want to insert a variable.
So we do it like this.
And then we just mention here the tuple and inside the square brackets.
We just mention the cell number like that.
Let's just print it for now so we'll know that we'll find that's our solution way is OK.
Yeah.
So it looks good so far, right.
We are ninja developers.
We write Python.
Right.
So, so far, so good.
So from here inside the round brackets, because this is our present, you see it's marked in yellow
here.
So inside the round brackets, we want to continue.
So we do it plus again and quotation marks to continue.
And we write you code, right, because we're continuing starting from this word.
So we need to continue this way.
Right.
Called in this regular string in and then we have PI charm.
Right.
So Pi Chameides was marked as negative extraction and we can start counting from here.
This is, this cell is number minus one, negative counting minus two, minus three and minus four.
So we need to mention the part, the tuple and inside the square brackets to.
Right.
Minus four.
So I'm just going to copy it.
Changed the number.
Yeah.
Right here.
Plus and then right.
Click and based.
We have two classes here.
Yeah.
And inside the square brackets put minus four like that again.
Let's just try to print it to see that we're in the right way.
So we're ninja developers, we write Python called in pi charm.
You see we have a small issue here.
We don't have space.
So after Python we need to put a space right here where the cursor is marking, blinking right now.
So right here, let's try to print it again.
And we're good.
All right, so we are good to go.
Let me just add here by picture ID, right.
So let's run it.
Yeah.
By Charmides so let's continue.
And after picture I.D., we have this and now practicing topical collections.
And our next word is Toppo.
Right.
So this is our next word.
So until this point, we just add a regular string again.
So we have Bloss quotation mark and codine by Charmides and we have a comma.
Right, because is this comma right here after Charmides, this comma right here.
So we put the comma and and now back to seeing Toppo.
Top Ball is marked for us in
positive meaning, regular extraction.
So we just put here a technological term and two because we have zero one and two.
Right subtable.
We extracted tuple right now and after tuple we have collection stop that will constrain string variables.
So string is our next word.
This one is our last extraction.
So right now we are in trouble.
So we need to continue from here.
You know what?
Let me just copy this one.
Yeah, it's the same way.
Copy.
Just going to show you some shortcuts because instead of writing it in the keyboard, you can also copy
it.
So plus quotation marks and inside quotation mark, we can just.
Right.
Click and paste it.
Right.
The same thing.
And now we need to extract the string, which is the last cell.
And we were asked to do it in negative extraction.
So just mentioning here plus in technological terms and square brackets minus one.
Yeah.
Like that.
So now we need to just add the last word plus.
Quotation marks and variables, yeah, like that, you see, it's it's a very, very long and we have
a line here.
Yeah, we have a line that goes from top to bottom right here.
And we cannot market it because it's on the background.
We'll see what we'll do it with it in a minute.
That's just print it for now and see that we are OK.
So we're in ninja developers.
We write Python called in by Charmides and nonpracticing tuple collections topic that contains string
variables.
That's for now.
Just add here a space after tuple.
Yep.
So practicing right here.
Yeah.
So now we should be fine.
Yeah.
So it's the same thing.
We have the same sentence in the output as we were asked to do like that.
Yeah.
It's the same one is going to raise it.
So we were great in this assignment.
So you can see like the background line here that goes from top to bottom.
It goes from from here under the name of the collection dictionary practice advanced here, the marker.
And it goes through this word now and you can see line here.
So if you see line it, it's here because PI Charm advises us not to cross this line.
So our code would be would look static.
So we don't want to cross this line.
So everything that we have here, we would like not to cross this line.
So the thing I'm going to do is right here to just hit enter.
All right, they didn't do the job, so let's go a little bit back and forth here under a lot right
after the four just hit enter here, right.
And just backspace, the whole thing.
Yeah, like that, and now for some reason, I have erased it.
Yeah, so you see, for some reason I raised the square brackets here, so I just edit it, edit it
in now.
All right.
We were OK, we're all we just passed the line a little bit.
But that's all right.
We're not we didn't not pass it a lot like it was before and now it looks more static.
So you just hit the enter and make sure we don't have any errors.
And you see, I hit the intro right after the square brackets here after the four.
And let's just try to print it and see that we were OK.
Yeah.
So to see the output is fine.
We didn't break anything and we're good to go for to the third assignment.
So we have completed successfully the second assignment of printing out the sentence using negative
and positive extraction.
And the third assignment we were asked to do the following thing, insert float.
And list variables into the tuple, so as you recall in the previous video, not the previous like the
one before it once we discussed advanced Toppo, we mentioned the tuple.
We cannot add variables.
We can add cells into Toppo.
We cannot modify it or delete it.
So the trick here is to create a new collection of list and to pass all the items from the tuple to
the list.
And in the list we will add some new cells and then we will cast the list back to topple.
Right.
So you can see it, by the way, you can see it in the advanced part of tuple.
There is an attachment file with all the material and you can see the example one by one right there.
So first of all, let's create a deck technological terms list.
Yeah, this would be a new collection.
Yeah.
And then we just mentioned we just do a casting of list and mention inside our toppled.
So what we did here, actually we have casted our tuple into a list.
Right.
This one is casting same as we do in the printout.
Right.
Same as you did right here.
We casted the top into a string.
So now we're casting the tuple into a list.
And this would be our list.
And once we were dealing with a list, yeah, we can add new items so you can see the lecture that handles
lists, the advanced part of lists that we previously studied.
And you can see there how to add new cells.
And the way to add new cells is using append action.
All right.
So we'll use a band and inside quotation marks, single double doesn't matter, we just add the items
float and we will add the item list like that.
And once we are done and again, we will mention the tuple equals.
And now what we need to do is to cast the list.
Yeah.
This one back to topple.
Right, with the new items inside it.
All right.
So you see what we did here?
We have three steps.
We have step number one, where we took the tuple and casted it into a list.
And this will be our list.
Then once we handle with the list, we added new items using a band action key.
And the third step was to take this list and to cast it back.
To topple and or topple will be equals to what we have here with the new items.
And once we did that, we can just print it and have the new items inside.
This is our new poll with the added cels.
Yeah.
Let's see the magic run.
Yeah, so you can see here the output is successful, we have added float and less to support successfully.
Great.
So this was wasn't an easy assignment.
This was a bit hard.
So because we needed to involve your list also together with Toppo, but this is what programming is
all about.
You need to mix all the topics all together, because eventually when you're going to write code, you're
going to use all the topics mixed together with string variables, lists, loops, eve statements all
together.
So it's a great example, great practice right here.
And the first fourth assignment was to create a single cell tuple.
Yeah.
So single cell Toppo like that.
And right here we studied that.
What we need to do is not to leave it like this, but to add the camera here and then just print the
single.
Sell to Apple.
Yeah, as always, just mentioning enter and also you were asked to bring the type of the top.
You know what, you don't need to add a string here.
Just mentioned the single celled Dupo and around it.
Just use the action key type with round brackets.
Let's print it and see that we're OK.
Great.
So we have printed it and also we can see here the type that is tuple.
All right.
This just add here a marker that it's the fourth assignment.
And let's see what happens if we just remove the comma from here.
All right.
Let's just remove the comma.
Once we remove the common, print it immediately.
You can see here that the variable that mentions here in the type is integer.
It became an integer.
So only if you leave here the comma, this becomes a double.
If you if you remove the comma, it's not double anymore.
It becomes a variable.
All right.
So this very important thing and I think that we are done OK.
So we have completed successfully the practice part of tuple.
This was not an easy assignment list right here.
And by now you can tap yourself on the shoulder and tell yourself, good job, because we have completed
successfully all the variables part of the course and also all the collection part of the course.
And that's a meaningful part.
All right.
That's about thirty or forty 40 percent of the python part.
And we can go straight forward to the next topic.
So that's about it.
And I will see you in the next video.