Pjay-001 / Open-cv

0 stars 0 forks source link

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) #1

Open Pjay-001 opened 3 months ago

Pjay-001 commented 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)