OOP in Python
What is OOP ?
An OOP is a way of programming that focues on using objects & classes to format design and build any applications.
In other words, OOP is a type of programming which is based on objects and classes rather than functions & procedures.
Ma...
mohammadishak47.hashnode.dev1 min read
Difference between POP & OOP
Principles of Object Oriented Programming
OOPs is based on the concept of objects rather than actions, and data rather than logic. In order for a programming language to be object oriented,it should have mechanism to enable working with class & objects as well as the implementation . Usage of the fundamental object oriented principles and concepts namely Inheritance, Abstraction,Encapsulation and Polymorphism.
Abstraction
Encapsulation
Here levels are public , protected, private, internal and protected internal.
In other words ,Encapsulation in Python describes the concept of bundling data and methods within a single unit. So, for example, when you create a class, it means you are implementing encapsulation. A class is an example of encapsulation as it binds all the data members (instance variables) and methods into a single unit.
Inheritance
Another way , The process of inheriting the properties of the parent class into a child class is called inheritance. The existing class is called a base class or parent class and the new class is called a subclass or child class or derived class.
Polymorphism