1 00:00:07,170 --> 00:00:07,660 Hi. 2 00:00:07,710 --> 00:00:08,430 Welcome back. 3 00:00:08,430 --> 00:00:18,890 Today we will discuss at Bluebird the crater delta in the crater airport about bison and property is 4 00:00:18,890 --> 00:00:30,320 built in the crater used to change our class methods or attributes so that the user of our class doesn't 5 00:00:31,100 --> 00:00:40,640 need to make any change in zip code example class fruit decaf double underscore and it does it underscore 6 00:00:40,700 --> 00:00:49,340 self and the name and the color column Zen and instantiation of self to our attributes name self. 7 00:00:49,340 --> 00:00:57,950 The name equal name self color equal color Zen and self-taught fruit type equal self with good name 8 00:00:58,100 --> 00:01:08,870 plus has plus a self that color plus color citrus equal fruit lemon and yellow 9 00:01:11,480 --> 00:01:20,160 print citrus dot name and the brand set as the color and the brand citrus that fruit type. 10 00:01:20,390 --> 00:01:25,640 We will get from the last to code lemon yellow lemon has yellow color. 11 00:01:25,670 --> 00:01:34,760 Okay but when we et cetera that name equal orange Brent citrus a good name and brand citrus color we 12 00:01:34,760 --> 00:01:37,150 will get orange and yellow. 13 00:01:37,220 --> 00:01:43,610 The name attributes gotta change it but the sentence that was created by fruit type attributes remains 14 00:01:43,610 --> 00:01:52,550 same as it was said during the initialization of citrus object so we will use python functions to solve 15 00:01:52,640 --> 00:02:00,660 above problem uh class root column def not an underscore any double underscore or in brackets self and 16 00:02:00,660 --> 00:02:07,580 the name and in the end the color close bracket column self Doc name equality set with the current equal 17 00:02:07,580 --> 00:02:14,690 color and we will cancel the third line through type initialization. 18 00:02:15,010 --> 00:02:21,620 Uh for name and change it to a function called fruit type the fruit type. 19 00:02:21,790 --> 00:02:33,740 So return serve dot name plus has and self blast self color blast color citrus equal fruit lemon and 20 00:02:33,740 --> 00:02:36,540 yellow blend citrus. 21 00:02:36,550 --> 00:02:50,360 The name brand citrus the color brand citrus fruit type method citrus the name Ecuadorians Brent citrus 22 00:02:50,360 --> 00:02:53,710 with name Brent citrus colors. 23 00:02:53,760 --> 00:02:55,500 Let's run our code. 24 00:02:55,890 --> 00:03:01,590 We will get lemon yellow lemon has yellow color orange and yellow. 25 00:03:01,740 --> 00:03:10,200 This solve it but we have removed the fruit type attributes from the constructor and add a method named 26 00:03:10,620 --> 00:03:11,840 for type. 27 00:03:11,850 --> 00:03:21,660 So now in our class there is no attribute to name fruit type and we have a method named fruit type. 28 00:03:21,690 --> 00:03:30,030 And when the any user use our class will be in trouble as they have to replace all attributes fruit 29 00:03:30,030 --> 00:03:33,970 type with a function called fruit type. 30 00:03:34,030 --> 00:03:37,470 Assume we have long code which has lots of lines. 31 00:03:37,890 --> 00:03:45,900 Then how extremely difficult it will be for the coders how extremely difficult it will be for the coders 32 00:03:48,920 --> 00:03:57,040 so we will solve this problem using the buy some property the creator as following add property def 33 00:03:57,530 --> 00:04:06,780 fruit type underscore type self column return sales with name but as the string has been thus self color. 34 00:04:06,810 --> 00:04:17,870 But as the string colors so there could well be as following plus fruit column the F double underscore 35 00:04:17,890 --> 00:04:21,290 any double underscore or mean bracket self. 36 00:04:21,490 --> 00:04:26,210 And name and color close bracket. 37 00:04:26,280 --> 00:04:34,750 Call them self name equal name self the same full of color equal color and we cancel the third line 38 00:04:35,500 --> 00:04:38,510 self that through type admirable. 39 00:04:38,680 --> 00:04:48,730 Dear fruit underscore type I'm in bracket self close bracket column with any self dot name plus string 40 00:04:48,760 --> 00:05:01,550 of space has its base plus self dot color plus of Amber entities space base color global entities citrus 41 00:05:01,730 --> 00:05:12,320 equity fruit lemon and dill brand citrus dot name Brent citrus color brands Brent uh citrus dot fruit 42 00:05:12,380 --> 00:05:23,060 underscore type citrus dot name equal orange with uh all capital citrus dot color equal orange with 43 00:05:23,150 --> 00:05:32,530 oh small four color Brent citrus the name Brent citrus just color Brent citrus that uh fruit uh underscores 44 00:05:32,530 --> 00:05:32,990 type 45 00:05:36,590 --> 00:05:45,050 and when we run our code we will get lemon yellow lemon has yellow color orange audience Orange has 46 00:05:45,110 --> 00:05:46,100 orange color. 47 00:05:46,220 --> 00:05:47,840 Thank you for watching. 48 00:05:47,840 --> 00:05:50,870 See you next lectures by.