Hey, welcome back.
Please don't skip this video because this is quite important.
You're going to learn the difference between a class and an instance.
And once you are clear what the difference is, then it's easier for you to create applications using
object oriented programming in Python.
All right, So I already gave you some clue what is a class and what is an instance in the previous
day.
So you saw, for example, that email this year is a class.
But then in here, this one here is an instance.
However, I think that is not enough for you to understand the differences between classes and instances,
because the programming world is abstract.
So what I want to do now is I want to have another example from the real world.
So let's say when I created this course, the Python mega course before producing any video or any coding
exercises, I first created some blueprints on a piece of paper.
As you have seen in the course, you had things like coding exercises, you had videos, cheat sheets,
frequently asked questions.
So all these were items of the course.
So these pieces of papers are like classes in Python, right?
So for example, I defined that the icon of a coding exercise will look like a pencil, and then the
coding exercise will start with this title followed by the number.
And then we'll have the question which gives you the student the task for this exercise.
And then after the question, there will be the solution as link.
So this is a class, this is a blueprint, but this is not an instance.
Now, an instance is created when I go to Udemy and I actually write an instance of this blueprint of
this coding exercise.
For example, I wrote a coding exercise above the match case.
BLOCK.
So that is an instance.
And then I created another exercise above the if else, conditional block.
So that was the second instance.
And in each instance I'm following this blueprint, this class.
So similarly in programming, when we create large applications, first we create some blueprints and
then we define exactly what the instances of these blueprints will look like.
The structure we define the structure of these instances, and then we use those classes to create instances.
Now you might be wondering why was the video blueprint empty?
Well, that is because videos are already defined as a blueprint, right?
I'm not the first instructor to create videos.
The other items, such as bug fixing exercises and coding exercises were customized items that I planned,
so I had to create some blueprints first.
But videos are blueprints which have been created by other people before, so I just have to follow
those blueprints and produce videos.
So similarly, in programming, there are cases when you have classes which have already been created
by other people.
An example of that would be the PDF class.
So we don't need to define that class.
We just need to import the name of that class PDF, and then we create PDF instances using that class.
So the same goes for videos.
In my case, when I create a course, I just produce the videos because I know already the blueprint.
So that was about classes versus instances.
I hope that makes things a bit more clear.
And now we're ready to create an application using classes.
So I'll see you in the next video.
Let's begin.