1
00:00:03,220 --> 00:00:06,340
We now move to a different matter types associate.

2
00:00:06,340 --> 00:00:15,460
For now, we work with the object methods like for example, the set face color and the set I color.

3
00:00:15,940 --> 00:00:23,860
The fact that this takes in the so as arguments, you're simply tells us that it's an object method.

4
00:00:24,190 --> 00:00:29,560
And with this object method we could modify the objects attributes, for example.

5
00:00:29,950 --> 00:00:37,210
So with a set face color, we could modify the face color attribute with the set I call out to modify

6
00:00:37,210 --> 00:00:38,710
the eye color attribute.

7
00:00:39,010 --> 00:00:42,610
Now let's define a separate method, which we'll call set.

8
00:00:43,720 --> 00:00:45,760
All right, a is.

9
00:00:46,840 --> 00:00:47,530
I.

10
00:00:48,640 --> 00:00:52,740
Equal is I equal face.

11
00:00:53,920 --> 00:00:59,020
So we have that and then we return self doubt.

12
00:01:01,460 --> 00:01:07,120
These color equals of the eye color.

13
00:01:07,390 --> 00:01:13,210
Now, the aim of this matter right here is to tell us whether the eye color is the same as a face color.

14
00:01:13,750 --> 00:01:14,830
So that's it.

15
00:01:15,010 --> 00:01:23,080
And obviously, we are going to take in the current object because we are going to do some modifications.

16
00:01:23,080 --> 00:01:23,440
All right.

17
00:01:23,440 --> 00:01:30,790
Up, because this output would depend on the object's face color and also its eye color attribute.

18
00:01:31,300 --> 00:01:34,630
Run that we have the side.

19
00:01:34,900 --> 00:01:36,070
Let's take this now.

20
00:01:36,280 --> 00:01:44,290
Let's say we have side that is eye, equal face.

21
00:01:47,260 --> 00:01:48,130
I'm going to do that.

22
00:01:48,130 --> 00:01:48,640
And as it.

23
00:01:50,300 --> 00:01:53,150
See, we have true telling knows that for the SAT.

24
00:01:53,540 --> 00:01:58,740
Let's go back to the SAT where we actually have the eye and the face the same.

25
00:01:58,760 --> 00:01:59,720
Let's bring out this.

26
00:02:00,080 --> 00:02:04,000
So I will print out all printed out already in the face color.

27
00:02:04,010 --> 00:02:04,370
Okay.

28
00:02:04,610 --> 00:02:07,280
We had the face called on the eye color yellow about black.

29
00:02:07,280 --> 00:02:08,090
So that was fine.

30
00:02:08,370 --> 00:02:10,700
Now if we modify this to red or on it.

31
00:02:13,540 --> 00:02:14,830
We still have double read this.

32
00:02:14,830 --> 00:02:18,910
An error or the error comes from the fact that, yeah, we didn't take this into consideration.

33
00:02:18,910 --> 00:02:19,810
That's eye color.

34
00:02:20,440 --> 00:02:20,700
Right.

35
00:02:20,740 --> 00:02:27,730
See they have now two different, uh, we look at the if I equal face we see now as false.

36
00:02:28,150 --> 00:02:36,640
Uh, also note that instead of calling this is I equal face like this I was defining the object and

37
00:02:36,640 --> 00:02:44,140
then we the object we call the matter, we could simply just have the smiley self so we could define

38
00:02:44,140 --> 00:02:49,440
smiley which takes on false face color.

39
00:02:50,470 --> 00:02:51,520
Equal red.

40
00:02:54,410 --> 00:02:54,990
That was it.

41
00:02:55,320 --> 00:03:01,350
So, yeah, we could define this class like this with this constructor would define the class ones that

42
00:03:01,350 --> 00:03:02,220
define the class.

43
00:03:02,460 --> 00:03:03,750
We now call on this.

44
00:03:05,300 --> 00:03:05,540
No.

45
00:03:05,540 --> 00:03:06,110
We run it.

46
00:03:06,440 --> 00:03:08,480
See, it gives us the same output.

47
00:03:09,350 --> 00:03:12,200
We can also define just the class like this.

48
00:03:12,890 --> 00:03:14,480
And then we pass inside.

49
00:03:15,080 --> 00:03:20,510
So now you see the reason why whenever we get this self right.

50
00:03:20,510 --> 00:03:22,550
Yeah, we're treating it as an object.

51
00:03:22,550 --> 00:03:24,770
So this is actually an object we're passing in.

52
00:03:26,150 --> 00:03:31,940
So this be seen clearly from the fact that we'll just define the class name here.

53
00:03:32,270 --> 00:03:37,460
So we just define the smiley and then we call the method and then pass this object which has already

54
00:03:37,460 --> 00:03:38,180
been defined.

55
00:03:39,170 --> 00:03:41,390
So this object set which has been defined.

56
00:03:41,390 --> 00:03:41,930
Right, yeah.

57
00:03:41,930 --> 00:03:47,150
We pass it and it just acts as if we were the same as what we had done previously.

58
00:03:47,150 --> 00:03:54,500
That was we had said that is, uh, equal face and that was it.

59
00:03:54,830 --> 00:03:56,030
Let's print it out.

60
00:03:57,860 --> 00:03:58,700
Print is out.

61
00:04:01,040 --> 00:04:01,700
And there we go.

62
00:04:01,880 --> 00:04:04,790
See, we have the same results from this.

63
00:04:04,800 --> 00:04:13,430
We could also something like this instead of having the SAT here, let's copy this from this to dissolve

64
00:04:14,420 --> 00:04:15,020
on that.

65
00:04:15,350 --> 00:04:17,990
And so we have exactly the same results.

66
00:04:18,920 --> 00:04:27,440
Now also note that there are some methods in a class which do not need to make use of, for example,

67
00:04:27,440 --> 00:04:30,710
this attributes of that object.

68
00:04:30,920 --> 00:04:38,300
Oh, there are some methods which don't need to take into consideration the fact that the modification

69
00:04:38,300 --> 00:04:43,460
we had to do in that matter will depend on the object with which we are working with.

70
00:04:44,450 --> 00:04:53,150
A simple example could be suppose that we are given now another attribute that is the self that reduce

71
00:04:54,800 --> 00:05:00,890
self, the radius attribute reduce and the radius.

72
00:05:00,890 --> 00:05:01,130
Right.

73
00:05:01,130 --> 00:05:01,730
Yeah.

74
00:05:02,780 --> 00:05:05,900
By default let's say takes a value of five.

75
00:05:06,740 --> 00:05:17,990
So we take a float everybody of five by default and then we want to calculate the area O and area and

76
00:05:17,990 --> 00:05:27,110
area that's and self and then we want to return the self doubt reduce.

77
00:05:30,570 --> 00:05:31,230
Times.

78
00:05:31,680 --> 00:05:35,640
C 3.14 is an approximation.

79
00:05:36,300 --> 00:05:38,450
The area of a circle is PI Radio Square.

80
00:05:38,460 --> 00:05:46,770
So we have this radius that's a 3.1, four times the radius square.

81
00:05:48,390 --> 00:05:50,990
That's the power of two.

82
00:05:51,030 --> 00:05:51,810
The power of two.

83
00:05:52,230 --> 00:05:59,100
Okay, so with this, we could compute the area, the head area of the smiley run.

84
00:05:59,100 --> 00:06:02,250
This let's just think for just happy.

85
00:06:02,460 --> 00:06:07,140
So we have happy that hat area called that.

86
00:06:07,410 --> 00:06:08,040
There we go.

87
00:06:10,140 --> 00:06:14,160
We could define the smiley so that it has the radius.

88
00:06:14,160 --> 00:06:17,760
So we could have radius equals to for example, and that's it.

89
00:06:18,390 --> 00:06:20,940
But what if we want to define a separate function?

90
00:06:20,940 --> 00:06:24,090
We just calculate the area based on the radius.

91
00:06:24,090 --> 00:06:29,100
So we have this area function which takes in the radius.

92
00:06:29,460 --> 00:06:35,850
So it takes in the radius and then it returns PI times the radio square.

93
00:06:37,410 --> 00:06:45,450
After defining this kind of function, which doesn't actually depend on the current object as a static

94
00:06:45,450 --> 00:06:49,340
matter, we have to include this decorator right here.

95
00:06:49,560 --> 00:06:54,090
The way we put out decorators is by using the act.

96
00:06:54,480 --> 00:07:00,270
And then particularly specifically for this decorator, it's called the static matter.

97
00:07:00,690 --> 00:07:03,210
So doing this or on that and there we go.

98
00:07:03,210 --> 00:07:09,960
We see that we use a classes named Smiley and then we pass in the value for directly.

99
00:07:10,170 --> 00:07:14,970
And yeah, we don't even need to construct the.

100
00:07:16,020 --> 00:07:22,800
SMILEY And also, we don't need to pass in any object into this method for us to get an output.

101
00:07:23,700 --> 00:07:32,400
And also, as we have seen from the beginning, we have all we could create attributes which are specific

102
00:07:32,520 --> 00:07:33,330
to the class.

103
00:07:33,720 --> 00:07:40,650
So we could have an attribute to is face or its upper body.

104
00:07:41,460 --> 00:07:43,050
It is upper body.

105
00:07:43,740 --> 00:07:45,210
And now we said that's true.

106
00:07:46,410 --> 00:07:48,540
So this is specific to the class.

107
00:07:49,140 --> 00:07:56,980
Now, if we want to define a function which takes this and then does some modifications, like said,

108
00:07:57,540 --> 00:08:08,460
if we want to say is body or is upper body there, you have to parse in this class to specify that we're

109
00:08:08,460 --> 00:08:09,480
passing in the class.

110
00:08:10,050 --> 00:08:14,610
And yeah, we return simply is upper body?

111
00:08:15,000 --> 00:08:17,280
Is upper body.

112
00:08:18,320 --> 00:08:19,090
So there we go.

113
00:08:19,110 --> 00:08:20,850
Now, yeah, let's take this off.

114
00:08:21,090 --> 00:08:30,810
We have the smiley that is our upper body on this.

115
00:08:30,960 --> 00:08:32,070
We have this arrow.

116
00:08:32,730 --> 00:08:34,560
Now we need to put in class.

117
00:08:34,560 --> 00:08:35,040
Yes.

118
00:08:35,040 --> 00:08:36,470
Yet as a body.

119
00:08:36,480 --> 00:08:37,200
And that's fine.

120
00:08:37,740 --> 00:08:43,040
We get into this output because this matches with the method name.

121
00:08:43,050 --> 00:08:49,010
So let's change this upper body and your upper body around that again.

122
00:08:49,020 --> 00:08:49,740
And that's okay.

123
00:08:50,730 --> 00:08:56,850
So it is within the three different method types, the class methods, the static methods, and also

124
00:08:56,850 --> 00:09:00,120
the instance methods.
