class Account:
    def __init__(self, number, name, balance):
        self.number = number
        self.name = name
        self. balance = balance

    def get_balance(self):
        return self.balance

    def set_balance(self, balance):
        self.balance = balance

    def withdrawal(self, amount):
        if balance >= amount:
            self.balance -= amount

    def deposit(self, amount):
        self.balance += amount
# Whenever you want to display an object you have to use the str method
    def __str__(self):
        return "Account: %s \n Balance: %s \n Name: %s" % (self.number, self.balance, self.name)

class Checking(Account):
    def __init__(self, number, name, balance, odlimit):
        Account.__init__(self, number, name, balance)
        self.odlimit = odlimit

    def set_odlimit(self, amount):
        self.odlimit = amount

    def get_odlimit(self):
        return self.odlimit

class Savings(Account):
    def __init__(self, number, name, balance):
        Account.__init__(self, number, name, balance)
        if balance < 5000:
            self.rate = .02
        elif balance >= 5000 and balance < 10000:
            self.rate = .025
        else:
            self.rate = .03

#def main():
#if __name__ == "__main__":
#    main()
