Python classes and objects
Python is an object oriented programming language .Every things in python treated as an object.python supports structured as well as object oriented programming language paradigms.
- A class contains data and methods that can access or manipulate this data.Thus a class is a collection of data and methods.A class is a blueprint (prototype) of an object. Thus a class lets us bundle data and functionality together.
- A user-defined blueprint/prototype for an object is known as class.example : House is an object where blueprint/prototype/model of house is known as a Class.
- A class is generic in nature,whereas an object is specific in nature.
- We can create many objects from one class.We can easily access the class member with the help of these objects.
- An object is also an instance of a class The process of creating this object is called instantiation
- We can also create our own classes.These are often called user defined data types but we generally uses ready-made classes in python.