1 00:00:00,390 --> 00:00:06,370 So right now, we are going to learn about this object oriented programming, even if you do not practice 2 00:00:06,390 --> 00:00:15,750 this object oriented programming, you you need to know how it works because many exploits will contain 3 00:00:15,750 --> 00:00:17,340 some of the programming code. 4 00:00:17,640 --> 00:00:24,120 So in that way, you can you need to understand that, uh, what are the functions you need, how to 5 00:00:24,120 --> 00:00:28,890 change some parameters and etc. and how to change the variables also. 6 00:00:29,520 --> 00:00:39,990 So these classes are like a blueprint of some data or a template of any, uh, members and the functions 7 00:00:40,350 --> 00:00:40,860 combined. 8 00:00:41,070 --> 00:00:49,740 So what if I have a college and college contained some metadata, like a number of buildings and benches 9 00:00:49,800 --> 00:00:56,040 and a number of computers, number of fans, etc. So that is like a metadata or a blueprint of the class. 10 00:00:56,230 --> 00:00:59,700 So objects are like instances of their class. 11 00:00:59,730 --> 00:01:04,050 So a student is the object of the class right across content. 12 00:01:04,050 --> 00:01:10,860 So many members and each the class contains some properties like number of students and a number of 13 00:01:10,860 --> 00:01:11,940 working days, etc.. 14 00:01:12,240 --> 00:01:19,200 So far, that class, there are some objects in your views, the student as an object. 15 00:01:19,440 --> 00:01:27,780 And this student contains some, uh, information like his first name, last name, and in certain instances, 16 00:01:27,780 --> 00:01:29,420 internist Mark Marcucci, etc.. 17 00:01:30,000 --> 00:01:34,230 So now let's go ahead and define a class that is the student class. 18 00:01:35,040 --> 00:01:43,800 The class defines the properties that a student should have to do in class, let's say student. 19 00:01:47,060 --> 00:01:54,920 And what do you want to do, you want to say so we sorry, can't know what you want to release. 20 00:01:57,900 --> 00:02:04,770 It's far too personal, so just I'm not going to add any color here. 21 00:02:05,040 --> 00:02:06,070 No, I don't want to lose. 22 00:02:06,090 --> 00:02:13,020 I want to say as one for school and one to one equals two student. 23 00:02:15,390 --> 00:02:22,590 And now I want to say this over braggarts, now we can create some properties for this current one, 24 00:02:22,770 --> 00:02:27,330 like this one that Fashanu. 25 00:02:29,800 --> 00:02:31,770 First name is equal to the Senate. 26 00:02:35,100 --> 00:02:39,060 Now, we can switch to one last note. 27 00:02:47,610 --> 00:02:56,160 No, this is the objects to one is the object of the student class and this is the class variable and 28 00:02:56,160 --> 00:02:59,660 this one is called instance variable or object variable. 29 00:02:59,880 --> 00:03:02,820 And this object contains the variable. 30 00:03:02,970 --> 00:03:10,740 And the first name it varies is the value of this verbalised last name is saying, you know, I can 31 00:03:10,740 --> 00:03:12,270 print these various. 32 00:03:21,300 --> 00:03:23,240 So let me go ahead and run this quote 33 00:03:25,950 --> 00:03:30,960 now, you will get the, uh, all put aside, because that is the last known. 34 00:03:32,930 --> 00:03:40,400 So if I want to add another student, details I want to do is equal to student. 35 00:03:43,680 --> 00:03:49,080 And I will add the properties of this student to like first name and last name. 36 00:03:54,210 --> 00:03:55,830 Let's answer. 37 00:04:01,620 --> 00:04:02,630 So predator. 38 00:04:06,050 --> 00:04:09,980 Now, I can simply just say two, one, two, two, two and two in the last. 39 00:04:14,810 --> 00:04:21,380 So you got the Predator, which is the last name of the student to so manually adding all these variables 40 00:04:21,380 --> 00:04:27,860 like first name, last names you have under students, adding like this for every student is so much 41 00:04:27,860 --> 00:04:31,880 time consuming and very, uh, tedious task. 42 00:04:32,300 --> 00:04:37,240 So I know what I want to do is I will say I will define a constructor. 43 00:04:37,940 --> 00:04:46,190 So this constructor will get executed whenever a object is created for this class and that constructor 44 00:04:46,190 --> 00:04:48,610 is defined by underscoring the school in it. 45 00:04:49,430 --> 00:04:52,580 It also stands for initializing any data. 46 00:04:53,960 --> 00:05:00,280 Whenever I call this to one, the student and this method will automatically gets executed. 47 00:05:00,830 --> 00:05:02,980 No one must and should parameter. 48 00:05:02,980 --> 00:05:07,520 You need to pass this self parameter, this self parameter. 49 00:05:07,520 --> 00:05:10,840 Our argument defines the object. 50 00:05:11,060 --> 00:05:18,590 So if it goes to one is equal to student, then this function will execute under the student one properties. 51 00:05:19,370 --> 00:05:23,820 So you will understand a within a few minutes. 52 00:05:24,170 --> 00:05:31,570 Now I would call and say I can also pass the first and last name here. 53 00:05:32,000 --> 00:05:33,110 Let's say first. 54 00:05:33,500 --> 00:05:34,430 Come on last. 55 00:05:36,620 --> 00:05:48,800 And I can say self that first name, so we need to put the self before this cross object where it was 56 00:05:49,160 --> 00:05:52,620 because to one's first name is this one, right? 57 00:05:53,060 --> 00:06:03,590 I will just say first and also self not name the second to last. 58 00:06:04,640 --> 00:06:08,810 So now we want to pass this first one last name in the student. 59 00:06:18,270 --> 00:06:26,910 So we are passing the two arguments and cynical and these will in this first and last variables and 60 00:06:26,910 --> 00:06:34,110 this its function, get ridiculous whenever we have or create an object that is to one. 61 00:06:34,290 --> 00:06:36,960 And this self refers to this to one object. 62 00:06:37,260 --> 00:06:45,250 So it will be told as to on that first name is equal to this first and to the second to last. 63 00:06:46,020 --> 00:06:49,500 So let me create this and then you get some more clarity. 64 00:06:53,990 --> 00:07:03,050 So the student two leaders convinced Know and Legian and this when all this update is being created 65 00:07:03,050 --> 00:07:08,060 at this rate, then this function gets executer and then all goes to this frustrated wall and region 66 00:07:08,060 --> 00:07:08,940 goes to this last. 67 00:07:09,680 --> 00:07:12,560 And then we are assigning to do that Fashanu. 68 00:07:13,160 --> 00:07:17,930 We are offering the self objects because this object is being rated. 69 00:07:17,930 --> 00:07:24,800 This object will be placed here, just like the two to that first name is equal to first and second 70 00:07:24,800 --> 00:07:25,270 to last. 71 00:07:25,790 --> 00:07:34,220 Now what I want to go into what I want to print is I read certain hours to one dot Fastnet. 72 00:07:40,650 --> 00:07:41,930 So I will be next to Google. 73 00:07:43,590 --> 00:07:44,940 So let's run this. 74 00:07:47,840 --> 00:07:49,810 And you can see the name or. 75 00:07:50,300 --> 00:07:56,900 I don't know, have been painted, so this is a very efficient way of assigning values. 76 00:07:57,140 --> 00:08:06,170 So definitely the you can just adding in one line, it is very, uh, timesaving and also spacing does 77 00:08:06,460 --> 00:08:07,460 500 students. 78 00:08:07,460 --> 00:08:08,950 It will take only 110. 79 00:08:08,960 --> 00:08:11,410 So rather than adding all these variables. 80 00:08:12,080 --> 00:08:15,230 So now you can also find some functions. 81 00:08:17,910 --> 00:08:20,100 So let's also add the. 82 00:08:23,920 --> 00:08:30,410 And you can also see yourself that pay is equal to pay, so it's not a problem. 83 00:08:30,580 --> 00:08:35,720 They will not collect because these objects will disappear and this is normal pay variable. 84 00:08:36,820 --> 00:08:46,420 And what they can do is I can define some function, which is increment increment of self, the cells, 85 00:08:46,420 --> 00:08:48,760 objects, increment function. 86 00:08:49,240 --> 00:08:53,320 So now I can say return. 87 00:08:54,840 --> 00:08:59,190 Self doubt that so that objects pay very well. 88 00:08:59,220 --> 00:09:11,910 This is this one and Sarah into 10, so so to pay for this to the student fees, it's a hundred and 89 00:09:11,910 --> 00:09:13,650 this one is two hundred. 90 00:09:15,240 --> 00:09:20,340 Now I want to switch to one, not in agreement. 91 00:09:22,590 --> 00:09:24,600 And that's due to that increment. 92 00:09:27,690 --> 00:09:30,420 Now you go down 2000 and 2000. 93 00:09:34,230 --> 00:09:39,150 So as you can see, you got the one thousand and two 2000, because this is going to be in the pay very 94 00:09:39,150 --> 00:09:44,970 well and the salary for that purpose of this pay variable, which is one hundred. 95 00:09:45,480 --> 00:09:52,640 And then whenever we are cutting instrument, uh, we we need to pass the self because these two, once 96 00:09:52,920 --> 00:09:56,700 they will be placed in here for just say, pay. 97 00:10:01,040 --> 00:10:03,400 It will be dispersed where you. 98 00:10:06,810 --> 00:10:15,940 So pay's not different because we need to define this in this local variable, local function available 99 00:10:15,990 --> 00:10:17,130 to this local function. 100 00:10:17,760 --> 00:10:19,170 Now you get the right answer. 101 00:10:25,790 --> 00:10:27,470 That's all for this realist. 102 00:10:28,520 --> 00:10:36,020 There is also like distracter which will execute after the update got digital. 103 00:10:36,470 --> 00:10:44,360 So that's all just more than enough for this python course and will be dropping some tools are writing 104 00:10:44,360 --> 00:10:46,260 our own tools in the next section. 105 00:10:46,790 --> 00:10:49,420 I mean, like, OK, in the future section. 106 00:10:49,820 --> 00:10:55,430 So in that this police videos are enough for making tools. 107 00:10:55,610 --> 00:11:02,060 And also if you see any other tool in the ghetto, you can easily understand by this because you have 108 00:11:02,330 --> 00:11:08,150 this object oriented programming, just even though these are the basics, you'll definitely understand 109 00:11:08,150 --> 00:11:09,230 the code when you see that. 110 00:11:09,830 --> 00:11:14,810 So by understanding the code, you can just simply change the contents. 111 00:11:14,820 --> 00:11:18,710 Are there are many expect will be very helpful in the manual expertise. 112 00:11:19,070 --> 00:11:25,040 When you have the python experts, then you can just simply change and you'll get much more understanding 113 00:11:25,040 --> 00:11:26,780 about this minor exploitation.