Open Pjay-001 opened 3 months ago
class Account: def init(self): self.balance = 10000 print("Account balance is: ",self.balance)
def deposit(self, amount): self.balance = amount + self.balance print("Account balance is: ",self.balance) def withdraw(self, amount): self.balance = self.balance - amount print("Account balance is: ",self.balance)
class CurrentAccount(Account): def init(self): Account.init(self)
current = CurrentAccount() current.withdraw(2000) Account balance is: 10000 Account balance is: 8000 class SavingsAccount(Account): def init(self): Account.init(self)
def savingsWithdraw(self, amount): if(amount < 1000): super().withdraw(amount)
class Account: def init(self): self.balance = 10000 print("Account balance is: ",self.balance)
class CurrentAccount(Account): def init(self): Account.init(self)
current = CurrentAccount() current.withdraw(2000) Account balance is: 10000 Account balance is: 8000 class SavingsAccount(Account): def init(self): Account.init(self)