Abstraction: ============ X-app: class pqr: data m1(): m2(): m3(): class abc: data m4(): m5(): ==> MOST IMPORTANT PRINCIPLE OF OOPs. ==> REFERS TO A PROGRAMMING APPROACH BY WHICH ONLY THE RELEVANT DATA ABOUT AN OBJECT IS EXPOSED BY HIDING REMAINING DATA. ==> HELPS: REDUCING THE COMPLEXITY EFFICIENCY OF AN APPLICATION TYPES OF ABSTRACTION: ==================== ==> 2-TYPES: 1) DATA ABSTRACTION ==> HIDING OF THE DATA INTERNALLY 2) PROCESS ABSTRACTION ==> HIDING OF THE IMPLEMENTATION of method. XBank: class ICICI Bank:(Object) Home_Loan(): Personal_Loan(): Car_Loan(): Education_Loan(): credits(): hiding implementation HBFC Bank: (Object) Home_Loan(): Personal_Loan(): Car_Loan(): Education_Loan(): credits(): own different implementation ======================================= Abstract Class: =============== Normal class ============= class myClass: a b mc = myClass() mc.a mc.b abstract class: =============== class abstract: a b m1(): mc = abstract() ==> error ==> The abstract class like a normal class but we cannot be instantiated. ==> we can use the abstract class as parent class/base class for constructing other classes. Creation of abstract class: =========================== module: abc Class: ABC method: abstractmethod # Creation of abstract class from abc import ABC, abstractmethod class Test(ABC): @abstractmethod def m1(self): print("This is an implementation for an Abstract Method.") return def m2(self): print("This is the concrete method.") t = Test() ======================================= Overriding of the Abstract Method: ================================== super(): ======= ==> it is used to call the abstract method in derived class ==> this can help to access the implementation as it is in derived class. Syntax: super().meth_name() # Overriding of the Abstract Class from abc import ABC, abstractmethod class demo(ABC): @abstractmethod def met1(self): print("This is an abstract method.") return def __met2(self): print("This is the concrete method.") class concreteClass(demo): # def met1(self): # super().met1() # return def met1(self): print("Hi") print("Hello") print("Good Morning") print("Welcome to Ashok IT.") def __met2(self): print("This is Abstract Class.") obj = concreteClass() obj.met1() obj.__met2()