Object-Oriented Programming
What Is a Class in Programming?
A class is a blueprint that defines the data and behaviour shared by a group of objects; each object made from it is an instance.
Definition
A class describes a kind of thing in a program: the data it holds (attributes) and what it can do (methods). An object is one concrete item built from that description. If Car is the class, your car and my car are two objects.
Classes are the core building block of object-oriented languages such as Java, C#, Python and C++.
How it works
A constructor runs when an object is created and sets its starting data. In Python the constructor is __init__, and self refers to the object being built or used.
Each object keeps its own copy of the attributes, while all objects share the methods defined in the class.