All right, so welcome back again. So in the previous session, we saw how to work with fire to be able to expose our functions, our classes, and to use them at sila. Now let's see how to add and work with position argument as well as optional argument, which is going to create another file. And this is going to be something very simple. We're going to call it us ops now. Go to clr.pi.
To either option augment or push not commit, then let's create a simple function is going to be greets right there, very simple. Then we're going to pass in print, which is going to be sent like Hello, the patient's name. Let's format underneath just as we did previously, to pass in the name variable here. The noun can disagree with it mean. Then at the top of our file, you're going to input fire to me Up to expose this backlash I see a lot. So let's use the sample modifier file that I posted i, this is the dictionary format.
So it's going to be greet. and greet lisara a function to it for the C Hello, or C by the way, this is going to be by C and a school by very interest, something very simple. This is going to be C Bye. Goodbye. Something very simple. We have two different functions and then we want to expose into exposing the first and the second function as C by C but I guess we have done something very simple and easy.
Let's see how to work with magnets. So by default This function that you have created these two patches can be used as either position now or not right? So let's call this one this is supposed to be fire. Now let's run this see what you have to FA Python now commit dash dash dash dope. So let me explain it to consider now it's given us our command see an increase as we have seen here, right? Same greet here.
Now to be able to see the full way of working with a critic, I just come back to this option and bring the good here. Good. Gentlemen to quick run over I guess each variable to agreed they're going to give us out and in bringing this particular option considered. The name is abortion argument. And by default, this name is actually position argument right? In normal functions, as opposed to to run it on one disk.
But clock. So I write like this and passing the name like receipt to show that to bring Hello. Very interesting that is one of the ways of working on it. This is an asset position argument. If I want to see it as an optional, let's go with this. The name correlates perfectly particular variable here, right parameter here, argument here that I can pass in to show and it's also going to wick so faggus option of using both a normal function Nikita petitioner optional by going to use this as an optional is have to specify with a Dutch Dutch name, very, very interested to just give us the option of using service aspect to let's say have another committee of age and another one for gender.
Right. So by default, these are going to be petitioner. So let's say hello, you are deceased. Ah, let's get another one. For the agenda do a dash. The toward agenda is if I see this one unless I'm thinking as we did previously, with the help part is now going to give us all of those name each agenda as position argument, right?
So these are positions with the position matters variable. So in case you want to run it up to run it like this, so give the livers Josh. The age is 24. Then agenda as listen bill, go to print perfect for us. Hello, Joshua 24. You me if I change the position?
Me like hello mill. You ages Josh? And then you are 24 See that? Hello mill. You are George your ages, you are 24. So the position matters very well.
So how do you fix this particular issue? Right. So to fix this issue, that's when you can also use the same thing as an option argument. How'd you do that? So, I just clicked on this then this as we did this and we got a wrong message can actually run it in this particular option of specifying this by name is Josh then the age as 24 then continue with Dennis portion of the gender as male, it's good to identify them variable. So, you are Joshua Jones for you me.
So by this option, I can change it in different format I can actually make it like this. rearrange it in a different format bring day, gender, face of New Age, after all, this list put in named a, as I see. Joshua, then the East us And he's going to identify them perfectly. So it is the best method of working with it. So with fire, you can either use your functions, right, as either optionality or as a segment that is the parameters or the argument for your functions as a positional or option argument that is very, very interesting, very cool. So these are optional in several other stuff.
But that's the basic idea, the basic idea that to run it as optional, just follow it in this particular format, very, very strict, right? You don't change anything. But to make it optional, just have to bring the dash dash in front of it, and you can change it in different format as you wish. So that's the basic idea behind it. So thank you for watching, and see you in the next session. Stay blessed.