So right now, we are going to learn about this object oriented programming, even if you do not practice
this object oriented programming, you you need to know how it works because many exploits will contain
some of the programming code.
So in that way, you can you need to understand that, uh, what are the functions you need, how to
change some parameters and etc. and how to change the variables also.
So these classes are like a blueprint of some data or a template of any, uh, members and the functions
combined.
So what if I have a college and college contained some metadata, like a number of buildings and benches
and a number of computers, number of fans, etc. So that is like a metadata or a blueprint of the class.
So objects are like instances of their class.
So a student is the object of the class right across content.
So many members and each the class contains some properties like number of students and a number of
working days, etc..
So far, that class, there are some objects in your views, the student as an object.
And this student contains some, uh, information like his first name, last name, and in certain instances,
internist Mark Marcucci, etc..
So now let's go ahead and define a class that is the student class.
The class defines the properties that a student should have to do in class, let's say student.
And what do you want to do, you want to say so we sorry, can't know what you want to release.
It's far too personal, so just I'm not going to add any color here.
No, I don't want to lose.
I want to say as one for school and one to one equals two student.
And now I want to say this over braggarts, now we can create some properties for this current one,
like this one that Fashanu.
First name is equal to the Senate.
Now, we can switch to one last note.
No, this is the objects to one is the object of the student class and this is the class variable and
this one is called instance variable or object variable.
And this object contains the variable.
And the first name it varies is the value of this verbalised last name is saying, you know, I can
print these various.
So let me go ahead and run this quote
now, you will get the, uh, all put aside, because that is the last known.
So if I want to add another student, details I want to do is equal to student.
And I will add the properties of this student to like first name and last name.
Let's answer.
So predator.
Now, I can simply just say two, one, two, two, two and two in the last.
So you got the Predator, which is the last name of the student to so manually adding all these variables
like first name, last names you have under students, adding like this for every student is so much
time consuming and very, uh, tedious task.
So I know what I want to do is I will say I will define a constructor.
So this constructor will get executed whenever a object is created for this class and that constructor
is defined by underscoring the school in it.
It also stands for initializing any data.
Whenever I call this to one, the student and this method will automatically gets executed.
No one must and should parameter.
You need to pass this self parameter, this self parameter.
Our argument defines the object.
So if it goes to one is equal to student, then this function will execute under the student one properties.
So you will understand a within a few minutes.
Now I would call and say I can also pass the first and last name here.
Let's say first.
Come on last.
And I can say self that first name, so we need to put the self before this cross object where it was
because to one's first name is this one, right?
I will just say first and also self not name the second to last.
So now we want to pass this first one last name in the student.
So we are passing the two arguments and cynical and these will in this first and last variables and
this its function, get ridiculous whenever we have or create an object that is to one.
And this self refers to this to one object.
So it will be told as to on that first name is equal to this first and to the second to last.
So let me create this and then you get some more clarity.
So the student two leaders convinced Know and Legian and this when all this update is being created
at this rate, then this function gets executer and then all goes to this frustrated wall and region
goes to this last.
And then we are assigning to do that Fashanu.
We are offering the self objects because this object is being rated.
This object will be placed here, just like the two to that first name is equal to first and second
to last.
Now what I want to go into what I want to print is I read certain hours to one dot Fastnet.
So I will be next to Google.
So let's run this.
And you can see the name or.
I don't know, have been painted, so this is a very efficient way of assigning values.
So definitely the you can just adding in one line, it is very, uh, timesaving and also spacing does
500 students.
It will take only 110.
So rather than adding all these variables.
So now you can also find some functions.
So let's also add the.
And you can also see yourself that pay is equal to pay, so it's not a problem.
They will not collect because these objects will disappear and this is normal pay variable.
And what they can do is I can define some function, which is increment increment of self, the cells,
objects, increment function.
So now I can say return.
Self doubt that so that objects pay very well.
This is this one and Sarah into 10, so so to pay for this to the student fees, it's a hundred and
this one is two hundred.
Now I want to switch to one, not in agreement.
And that's due to that increment.
Now you go down 2000 and 2000.
So as you can see, you got the one thousand and two 2000, because this is going to be in the pay very
well and the salary for that purpose of this pay variable, which is one hundred.
And then whenever we are cutting instrument, uh, we we need to pass the self because these two, once
they will be placed in here for just say, pay.
It will be dispersed where you.
So pay's not different because we need to define this in this local variable, local function available
to this local function.
Now you get the right answer.
That's all for this realist.
There is also like distracter which will execute after the update got digital.
So that's all just more than enough for this python course and will be dropping some tools are writing
our own tools in the next section.
I mean, like, OK, in the future section.
So in that this police videos are enough for making tools.
And also if you see any other tool in the ghetto, you can easily understand by this because you have
this object oriented programming, just even though these are the basics, you'll definitely understand
the code when you see that.
So by understanding the code, you can just simply change the contents.
Are there are many expect will be very helpful in the manual expertise.
When you have the python experts, then you can just simply change and you'll get much more understanding
about this minor exploitation.