We now move to a different matter types associate.
For now, we work with the object methods like for example, the set face color and the set I color.
The fact that this takes in the so as arguments, you're simply tells us that it's an object method.
And with this object method we could modify the objects attributes, for example.
So with a set face color, we could modify the face color attribute with the set I call out to modify
the eye color attribute.
Now let's define a separate method, which we'll call set.
All right, a is.
I.
Equal is I equal face.
So we have that and then we return self doubt.
These color equals of the eye color.
Now, the aim of this matter right here is to tell us whether the eye color is the same as a face color.
So that's it.
And obviously, we are going to take in the current object because we are going to do some modifications.
All right.
Up, because this output would depend on the object's face color and also its eye color attribute.
Run that we have the side.
Let's take this now.
Let's say we have side that is eye, equal face.
I'm going to do that.
And as it.
See, we have true telling knows that for the SAT.
Let's go back to the SAT where we actually have the eye and the face the same.
Let's bring out this.
So I will print out all printed out already in the face color.
Okay.
We had the face called on the eye color yellow about black.
So that was fine.
Now if we modify this to red or on it.
We still have double read this.
An error or the error comes from the fact that, yeah, we didn't take this into consideration.
That's eye color.
Right.
See they have now two different, uh, we look at the if I equal face we see now as false.
Uh, also note that instead of calling this is I equal face like this I was defining the object and
then we the object we call the matter, we could simply just have the smiley self so we could define
smiley which takes on false face color.
Equal red.
That was it.
So, yeah, we could define this class like this with this constructor would define the class ones that
define the class.
We now call on this.
No.
We run it.
See, it gives us the same output.
We can also define just the class like this.
And then we pass inside.
So now you see the reason why whenever we get this self right.
Yeah, we're treating it as an object.
So this is actually an object we're passing in.
So this be seen clearly from the fact that we'll just define the class name here.
So we just define the smiley and then we call the method and then pass this object which has already
been defined.
So this object set which has been defined.
Right, yeah.
We pass it and it just acts as if we were the same as what we had done previously.
That was we had said that is, uh, equal face and that was it.
Let's print it out.
Print is out.
And there we go.
See, we have the same results from this.
We could also something like this instead of having the SAT here, let's copy this from this to dissolve
on that.
And so we have exactly the same results.
Now also note that there are some methods in a class which do not need to make use of, for example,
this attributes of that object.
Oh, there are some methods which don't need to take into consideration the fact that the modification
we had to do in that matter will depend on the object with which we are working with.
A simple example could be suppose that we are given now another attribute that is the self that reduce
self, the radius attribute reduce and the radius.
Right.
Yeah.
By default let's say takes a value of five.
So we take a float everybody of five by default and then we want to calculate the area O and area and
area that's and self and then we want to return the self doubt reduce.
Times.
C 3.14 is an approximation.
The area of a circle is PI Radio Square.
So we have this radius that's a 3.1, four times the radius square.
That's the power of two.
The power of two.
Okay, so with this, we could compute the area, the head area of the smiley run.
This let's just think for just happy.
So we have happy that hat area called that.
There we go.
We could define the smiley so that it has the radius.
So we could have radius equals to for example, and that's it.
But what if we want to define a separate function?
We just calculate the area based on the radius.
So we have this area function which takes in the radius.
So it takes in the radius and then it returns PI times the radio square.
After defining this kind of function, which doesn't actually depend on the current object as a static
matter, we have to include this decorator right here.
The way we put out decorators is by using the act.
And then particularly specifically for this decorator, it's called the static matter.
So doing this or on that and there we go.
We see that we use a classes named Smiley and then we pass in the value for directly.
And yeah, we don't even need to construct the.
SMILEY And also, we don't need to pass in any object into this method for us to get an output.
And also, as we have seen from the beginning, we have all we could create attributes which are specific
to the class.
So we could have an attribute to is face or its upper body.
It is upper body.
And now we said that's true.
So this is specific to the class.
Now, if we want to define a function which takes this and then does some modifications, like said,
if we want to say is body or is upper body there, you have to parse in this class to specify that we're
passing in the class.
And yeah, we return simply is upper body?
Is upper body.
So there we go.
Now, yeah, let's take this off.
We have the smiley that is our upper body on this.
We have this arrow.
Now we need to put in class.
Yes.
Yet as a body.
And that's fine.
We get into this output because this matches with the method name.
So let's change this upper body and your upper body around that again.
And that's okay.
So it is within the three different method types, the class methods, the static methods, and also
the instance methods.