I request you read last post before Inheritance. Lets kept going with banker analogy

  1. After Filling the form.
  2. Now, how much money do you want to deposit.
class BankForm:
    def __init__(self,Name,DOB,AdhaarNo,PAN):
        self.Name=Name
        self.DOB=DOB
        self.AdhaarNo=AdhaarNo
        self.PAN=PAN
    def full_name(self):
        return f"{self.Name} {self.DOB} {self.AdhaarNo} {self.PAN} {self.deposit}"
   
class Deposit(BankForm):
    def __init__(self,Name,DOB,AdhaarNo,PAN,deposit):
        super().__init__(Name,DOB,AdhaarNo,PAN)
        self.deposit=deposit
    
Rohan=Deposit("Rohan","12-09-2025","xxxx8907","KB1234","2000")

print(Rohan.full_name())
  1. Now I have created Deposit class in this I have data of people how much money they hold.
  2. And I have inherited the class BankForm Where they information about account holder.
  3. If we can inherit the class so definitely we can inherit there attribute. By using 'super'.
  4. 'super' it is just like I want to inherit attribute of my parent.
  5. And we can create new attribute of our own like deposit, also inherit there function which is full_name()
  6. But if you notice correctly I have played around and add deposit in full function and it return the deposit value also.