In the following code snippet, there are definitions of thre…

Questions

In the fоllоwing cоde snippet, there аre definitions of three clаsses: BаnkAccount, CheckingAccount, and SavingsAccount. The implementation shown below uses inheritance techniques, where CheckingAccount and SavingsAccount are children of BankAccount. After executing the function calls below, what is the output? class BankAccount:    interest_rate = 0.02        def __init__(self, owner, balance):        self.owner = owner        self._balance = balance        def deposit(self, amount):        self._balance += amount        def get_balance(self):        return self._balanceclass SavingsAccount(BankAccount):    interest_rate = 0.05        def apply_interest(self):        self._balance += self._balance * self.interest_rateclass CheckingAccount(BankAccount):    def __init__(self, owner, balance):        super().__init__(owner, balance)        self.interest_rate = 0.01account1 = SavingsAccount("Alice", 1000)account2 = CheckingAccount("Bob", 1000)account1.apply_interest()account2.deposit(account2._balance * account2.interest_rate)print(f"Alice: ${account1.get_balance()}")print(f"Bob: ${account2.get_balance()}")