Abstraction: ============ ==> Abstraction is the fundamental concept in OOP. ==> It is the process of showing the essential data and hiding of the unessential data is called "Abstraction". Ex: class MyClass: def m1(): # implementation not important # hide def m2(): # implementation class MyClass1(MyClass): def m1(): implementation1 class MyClass2(MyClass): def m1(): implementation2 ==> To implement the abstraction: module: abc module from abc import ABC, abstractmethod # here: abc ==> module name # ABC ==> Abstract Class class Vehicle(ABC): @abstractmethod def start_engine(self): pass @abstractmethod def stop_engine(self): pass @abstractmethod def drive(self): pass def greets(self): print("Welcome.") class Car(Vehicle): def stop_engine(self): print("Car engine stopped...") def start_engine(self): print("Car engine started...") def drive(self): print("Car is driving...") # class BiCycle(Vehicle): def start_engine(self): print("Bicycle Engine started...") def stop_engine(self): print("Bicycle Engine stopped...") def drive(self): print("Bicycle is driving...") # vh = Vehicle() # # vh.drive() car = Car() car.drive() car.greets() by = BiCycle() by.start_engine() by.greets() Benefits: ========= 1) Code maintainability is easy. 2) Flexibility 3) Simplification 4) Security ======================================================== class Employee: def __init__(self,name, age, position): self.name = name self.age = age self.position = position def __str__(self): return f"{self.name},{self.age},{self.position}" class EmployeeManager: def __init__(self): self.employees = [] def addEmployee(self,name,age, position): employee = Employee(name,age,position) self.employees.append(employee) def displayEmployees(self): if not self.employees: print("No Employees found..") for emp in self.employees: print(emp) def findByPosition(self,position): found = [emp for emp in self.employees if emp.position == position] if found: for i in found: print(i) else: print("No employees found.") def deleteEmployee(self,name): for emp in self.employees: if emp.name == name: self.employees.remove(emp) print(f"Deleted {name}'s record.") return print(f"Employee {name} not found.") manager = EmployeeManager() manager.addEmployee("Harshitha",24,"Software Associate Engineer") manager.addEmployee("Bhavadeep",22,"Automation Test Engineer") manager.addEmployee("Charitha",26,"Software Engineer") print("EMployee List:") manager.displayEmployees() print("================================") print("Finding Employee:") manager.findByPosition("Software Engineer") print("============================================") print("Deleting EMployee...") manager.deleteEmployee("Ravi") ================================================================= Python Debugging: ================= Debugging in python involves identifying, diagnosing and fixing bugs in the program.