'''
Created on May 9, 2021

@author: kivag
'''

class InvalidWithdrawal(Exception):
    
    def __init__(self, balance, amount):
        super().__init__(f"account doesn't have ${amount}")
        self.amount = amount
        self.balance = balance
        
    def overage(self):
        return self.amount - self.balance

try:
    raise InvalidWithdrawal(20, 50)
except InvalidWithdrawal as ex:
    print("Withdrawal larger than balance by", ex.overage(), 'leva')

e3b7932968f2cd09dc5a4f6fc48c03c455a5c807
<mask token>


class InvalidWithdrawal(Exception):
    <mask token>
    <mask token>


<mask token>

<mask token>


class InvalidWithdrawal(Exception):
    <mask token>

    def overage(self):
        return self.amount - self.balance


<mask token>

<mask token>


class InvalidWithdrawal(Exception):

    def __init__(self, balance, amount):
        super().__init__(f"account doesn't have ${amount}")
        self.amount = amount
        self.balance = balance

    def overage(self):
        return self.amount - self.balance


<mask token>

<mask token>


class InvalidWithdrawal(Exception):

    def __init__(self, balance, amount):
        super().__init__(f"account doesn't have ${amount}")
        self.amount = amount
        self.balance = balance

    def overage(self):
        return self.amount - self.balance


try:
    raise InvalidWithdrawal(20, 50)
except InvalidWithdrawal as ex:
    print('Withdrawal larger than balance by', ex.overage(), 'leva')

'''
Created on May 9, 2021

@author: kivag
'''

class InvalidWithdrawal(Exception):
    
    def __init__(self, balance, amount):
        super().__init__(f"account doesn't have ${amount}")
        self.amount = amount
        self.balance = balance
        
    def overage(self):
        return self.amount - self.balance

try:
    raise InvalidWithdrawal(20, 50)
except InvalidWithdrawal as ex:
    print("Withdrawal larger than balance by", ex.overage(), 'leva')
