Alright, so welcome back again. So in the previous session, we saw how to work with option arguments. So now let's see how to work with them in a form of argument called positional argument. Right? So these are optionals. They are not a must.
They're not mandatory, right? You can omit it and still going to work. But let's see how to work with ones that are a must, which are usually called positional argument. So let's create another file. And let's call that boost. cla.pi.
Right, let's let's put admit, see that just by very interesting now going to input at pass, as we do every time, create our main function to be our main function, and then less, push it away with the clues in physical education later up. Then we initialize our parser to be our arc pass, good argument. Pass, pivot you can just keep our program name The name of the program that you want to keep, we can omit it emotionally to it right. So let's go to our position now. The question admit, I must, right so first of all the mandatory mandatory and then they do go without it, it just has to do without dash dash today. So let's see how to create a simple push document.
So I'm just going to go with parser dot add argument. And then to to have the capacity to identify that anything I just read out and like without the dash is a position argument. So let's go with this the first name, right, and then now I can just go straight away with the help option. Enter your first name to your first name. The first name, fifth, write it. So let's go straight away with this.
Now we can just come back to our Storage tiny space storage storage. Derrick is Greta ox going to be pasa totes pass packs actually printed out with our print x. So let's see with a list Run DMC. So come back to our location to Python three, the name of the CLA help. So this is going to be now position argument and Polycom under this positional argument location. So we have our option argument.
They have opposite argument right to case I want to run it away with it, that it must always be positioned to the first name is going to be Peter is going to print namespace first name is Peter. That is going to be that so let's run our Last name, see this one as last name, right, so let's move to see the difference. So there's going to be our last name, your last name, last. Your last name last pivot. So let's run it again and see what you have done so far. So I come back here, it's going to add that petitioner admit panda.
So last name, first name, because I want to run it and just come back again to the same thing. So PETA can match us. So it's not going to be printed as the last name, if I change it. Let's go with my tooth eradicated are much easier. My TCC surname or last name and unless a PETA first name is smart use right so it supposed to be a last name. And then Peter is also supposed to be their first name.
So the position matters equally, like my position is very, very important. But I want to give you different results. There's actually a senior so that is one of the ways who just like optional coming to Congress Do the same thing. Let's go print something like your first name is this. And then your last name was Danny, let's go to Sydney is this possible option format. So in case you want to pass it, they're just going to read x dot the first name.
This gives us like an option argument, the same thing, because the newspaper content out there in this one is going to be our x. But Lastly, if I save it now and I come back in here, and run everything, like previously, everything is working well. If I run the same example that we had, which is PETA in my tooth, went to print out to your face name is Peter. Your last name is Marty if I change the position again, like we did previously, which might use as the first name and last name, to print it out. So your first name is matches and you're standing protected personnel are very very important because they are truly a must right? You can't go without it.
So the same tonight citizen must come back to this place and I will meet them it's going to keep us alive. So required Lastly, right so I can actually set a default also get I don't be given us required. That is the basic idea to the IMS. If I run it without it it's doing give us an error. So was no commit a must be a mandatory and then in nutshell the basic idea which was an argument is that it's must go without a dash dash right. And it's this petitioner the position parties and they are required to thank you for watching as seen in this session.
Stay blessed.