On in this particular session, we would be learning about Ogg's and GWM.
So first of all, before completely digging into what these are, let us try to understand what is the
actual need for this.
So let me simply create a function C. diff.
This is my function name, which is my phone, and in my function, I want to give two arguments the
economy.
And as a result, I want to read on.
There's some.
Of the values which I've got as my argument, so let's say a form of.
So let me run this particular function, so my.
And let us say, I want to get us out of a hundred and fifty.
So on running this, I get 150 as a result.
Now, let us try another scenario now in this particular case, let us say I want to have.
Some of these values only.
That is one difference which I want to have you.
I want to have a default value as zero so that in case I want to have more numbers, I want to add more
numbers.
I'm not sure how many numbers I will have, but I know that the maximum number of values which I will
be getting is five.
I just want to do a song for them.
So let us copy this entire thing again and create this function again.
But this time I want to given more value, Cissie.
Dean and.
Now, I can do the same thing here.
And I can return the news now, it's fine if I have five values in hand and I run this, I will get
the result.
But let's say I'm not sure how many values I have.
So what I can do is I can put a default value as.
And in that case, if I only have to use.
This would still work, but if I have just one value.
It was minister.
So let us run this again so far that what I can do is I can again give a default value to all of these.
This is perfectly fine if I have an upper limit to the number of values which I will be having, but
in case I might have state, instead of these five values, I can have a hundred values or thousand
values, then it would be difficult for me to track how many variables I have created and to keep a
note of each and every variable and write the entire piece of code again and again.
So this is where the need for are coming.
So what I can do here is I can create another function.
In the same way.
And in this function, I can give the initial values as default if I want if I don't want to give a
default value and I wanted to throw in it, or I can do that also.
But let us I just want to give the two values as default.
And I want to give the value, which is I'm not sure I know that I will be getting at least two values.
So let me bring these also.
I am not sure if I will be getting more than two values or I'm just I just know that the minimum number
of values would be, too.
So I'm ready for those.
And whatever extra values I'll have, I'll keep them as a part of star parks.
Now, this is just a name which we have provided.
We can have any other new also instead of OG's.
I can give name or names or X, Y, Z, anything instead of ours.
But by default, just to make it a little simplistic in nature, we just give it to you.
And instead of returning some of this, what I can do is I can simply return to some of this.
Plus.
The SAML.
Thanks.
So here this ogg's is present in form of a couple.
So it will basically some values inside this of some key values of this under this.
So here we have the desire and in case we have more number of values, it can add those also and it
could be any number of values and it will be judged on the result accordingly.
Another thing to note here is.
The minimum number of values which it is expecting.
It's to.
Because we have already said that it will be getting in the.
So if we are not sure that the minimum number of values will be true, then what we can do is we can
remove these.
So what will happen is let's say we have just one value and we don't have other values.
So in that case, if we done this, if you give us an error because it needs oppositional argument.
So what we can do is instead of this, we can simply say we don't want this value.
We want just one value a.
And we don't want this additional value here, so based on this, it will walk perfectly fine.
So it is not a trivial in nature.
So instead of having this complex structure, we can simply have only Ogg's present and then we don't
have any restriction.
We can given one value we can give any number of values, any number of values could be given.
And it was just as good as before.
This is about Star.
So this is when we have one type of value, which we are not sure how many values would be present.
So in that case, we will be using start ups.
Now, that is on the that type of method which we have, which is the Blue Ox, which is basically keyword
arguments.
OK, so when we say.
Star OG's.
It does for one of values and always remember the values which are which we are sure we would be providing
would be coming up first.
After that, we will be declaring the start ups and even after that, we will be starting talking about
the KW.
So this is the cynics and this is the order in which we will always be providing the arguments and the
documents.
So this is one thing to be remembered.
So let me to move this.
And he worded argument is given with two stars in front of it.
So this would be AWB.
Again, the state of new ogg's could be replaced by any of the characters or any of those strings would
be.
Hello, hi.
My name, your name, anything like that and all it can be used for.
Multiple values.
That began with the same two a.m. phone from.
OK, now let us see an example of this.
So this gate of new arguments is in a form of a dictionary, so whenever I will be giving this, I will
be giving it in form of a dictionary.
So what I can do is so let me declare a function again.
See this?
And again, my funk.
And in this function, I want to give or let us say I want to give two values, C and B, these are
two default value, which I will be anyhow giving.
So I'm just giving the name in case I want to give any of the traditional values.
Then I can give the start of which is of which may or may not be given.
And after that let's say I have these key worded arguments.
OK, this is what I want to have an interest of this, what I want to do is I want to let us see the
first operation, which I want to do is I just want to print the letter, say the sum of these values.
So I want to print A plus B, OK?
This is what I want to do.
And after that.
I want to check.
If let us say.
I'm just talking about different values, so let's say we are talking about fruit, so let us say I
want to have something like if some fruit.
Is president.
In my key ordered arguments, OK, if in the keyboarder documents, I have some fruit.
Then what I wanted to do is I just want to bring back.
I love to eat.
And then I want to give this in a dictionary form, right, and this has to be sort of, you know,
for my thing, kind of a structure.
So what I can do is I can simply say I love to eat and then I want to have the name of the value which
I want.
I would love to it.
And then I give DOT.
OK, just in mustering you.
And what I love, I love to eat the value from the dictionary, so remember I said that we will be giving
this in form of a key value pair or a dictionary form.
So the dictionary name is KW Elsea.
So KW adds, I'm from the gate was what is my key?
Fruit is the key, which is that OK, so I'm checking for fruit so it will check in the dictionary which
fruit you will you have provided that you like and based on that.
It will give the result.
OK, so we will just try to bring this back if this happens, it's well and good.
If this doesn't happen, then I can see else.
Brent.
I paid.
It's.
So this is the function.
And let me see my fun.
I'm inside this, I want to give the value see twenty three point fifty four, which I want to add,
I don't want to give any arguments so I can completely skip that.
And in include I want to give.
Of Throop.
And the fraud, which I want to give, is saying.
Banana and I have a veggie.
And what would do I like?
Let us say.
Garrett.
So let me run this.
And here we get seventy seven, which is the sum of twenty three and fifty four, and I get I love to
eat bananas, so let us say we didn't have fruit inside this.
And I just simply done this so it would give me a true test, the result.
So I just put that back, so similarly, we can have any number of these values so I can have formed
vegies and like and have chocolate or anything within here.
And based on that, I can give any values and I can have any arguments.
And he wanted arguments.
The only thing we can get off is that it has to be in this particular format that the rebels have to
be forced.
Then the arguments have to be given and followed by the keyword argument.
And based on this, you can simply create any index or anything like that and you can just create any
of your code using this entire syndicate, which has been provided to.