DEFINING HOW TO CREATE AN INSTANCE OF A CLASS First have to define how to create an instance of class Use a special method called __init__ to initialize some data attributes or perform initialization operations
A blueprint for a new type of Python object! The blueprint describes a general structure, and we can create specific instances of our class using this structure.
Python contains a class creation mechanism that’s fairly similar to what’s found in C++ or Java. There are significant differences though: All class members are public. Instance fields aren’t declared. Rather, you just create fields as needed by assignment (often in constructors).
Class: A user-defined prototype for an object that defines a set of attributes that characterize any object of the class. The attributes are data members (class variables and instance variables) and methods, accessed via dot notation.
Collections of objects share similar traits (e.g., data, structure, behavior). Collections of objects will form relationships with other collections of objects. A class is a specification (or blueprint) of an object’s structure and behavior. An object is an instance of a class.
The definition for creating the type is called creating a class. To use a class, one must create an object (an instance) of that class. This is essentially declaring and initializing a variable of the type you just created. All classes in Python must have the following components: