All right, so welcome back again. So in this last session of the course, we try to do a simple exercise with orders you have played with fire. So this is going to be as simple as be creating a simple COI that can add two numbers, subtract two numbers, multiply and then divide two numbers. So there's going to be a simple, simple aside to pause the video and then answer it later on and compare it to what you have done. All right, so welcome back. So let's see the workflow and the asset that you be trying to use for this class simple CLA.
There are several ways you can do it. But let's make it in this simple format. I'm just going to create our file. And then we went to call it us How simple is a calculator? I wouldn't call it us. Basic.
Let's just call call zeolite dot pie, right pivot. Let's see how to look at it. So I'm just going to import via then what you're going to do is we're going to create a function that will add another function To multiply and a function that can subtract and so forth, right and another function that can divide to decide the big parties between so let's see how to infinity phase function that is going to be used to add is going to be a diff. Let's just add that nauseam is and then my Why isn't why for the number. They're like I just putting in a special option of return x plus y, something very simple right? So it is a simple function.
So I can also do the same thing for multiply and subtract to less. There's a four subtract before we multiply there's going to be diff add, no subtract, subtract, I don't know what I did subtract, subtract without is eight bits. Then I pass him is in my Why did not pass and retain x minus y. Very simple. There's going to be the next function that we need a third function to be dif. defined a function called multiply multiply is, have you seen a mistake you made in a multiply, we call it as multiple.
Multiply, didn't passing by retain is by Why did they find out what's going to be 45. So diff divide is in a way, and I'm good to go retain s divided by y. Perfect. So that is something basically I've done unless you have to convert this class that we have done so far into theory. So by best practice, you should always at least keep a documentation. Unit documentation here is going to be add two numbers, add numbers Right pivot, then we want to do another one for subtract two, at least we have some documentation for it, this is going to be subtract, then this is going to be multiply, multiply, then the final one is going to be how to go to be deployed?
Very simple and very interesting, right? So we have created these functions, all of them are working now how do you convert it to UCLA? So we have already imported via CBT pi to enable us to convert this entire stuff into a CLA. If I just come back to this place, then go to this option of the evening. Then my fire was fire. Fair, right.
So this option, I'm going to expose everything right by default, if I go with this option, we'll just put everything. Let's leave it in this, see what you have done to Python three, then our code CLA dash dash dash dash help, I see that we have our result working perfectly well. So everything I've been exposed to say that our documentation is coming at lambaste, subtract numbers, what apply and divide. So to work with that, I can just come back to this clip of this. Let's be clear, to be add, like I'm passing the number of Lizzie 20 and then 50 go to bring it to 80. Right.
So that is how to work with it. So that is the simplest solution to it. Very interesting. Because we do same thing for multiply. It's also going to make sure that is when we and as we went along with this option, we can actually specify what you want to do. So let's go to subtract, subtract minus 25.
In case I want to make it 20 through 20. I can actually Change the position by going to 50. And agreeing with Ted then is going to keep us steady. Right? Very interesting. But I can also use the positional argument.
These are optional made by that kind of so use the option argument format by coming to the same thing. And going with that as S. Two S is going to be 50. And y is going to be a state, right? So I'll do it is still going to give us 20. So both of them work either use this particular format, or use this particular format as the power of fire. So fire gives you the option of using either position or option argument.
But with oceanographers, you have to specify them. That is a basic idea to be able to boot something very interesting with this. So congrats. And then see you in the next session. Stay blessed.