Encapsulation: -------------- Encapsulation is the process of binding of data (variables/attributes/properties) and methods together inside a class. Restricting direct access to sensitive data. => to implement the encapsulation we need: private members ==> which are prefixed with __ getters and setters class BankAccount: def __init__(self,account_number,balance): self.account_number = account_number self.__balance = balance def get_balance(self): return self.__balance def deposit(self,amount): if amount > 0: self.__balance += amount print(f"Deposited Rs.{amount} New Balance = Rs.{self.__balance}") else: print("Invalid depsit amount.") def withdraw(self,amount): if 0 < amount <= self.__balance: self.__balance -= amount print(f"Withdraw Rs.{amount} Remaining Balance = Rs.{self.__balance}") else: print("Insufficient funds or Invalid withdrawl amount") account = BankAccount("1234560789",45000) print("My Account Balance = ",account.get_balance()) account.deposit(55000) account.withdraw(5000) account.__balance = 500000 print(account.get_balance())