diff --git a/bank.py b/bank.py index ab74f6f..f108c9d 100644 --- a/bank.py +++ b/bank.py @@ -81,7 +81,12 @@ def get_transaction_history(self): def apply_interest(self, rate): # Applies interest based on a given rate. - pass + if rate < 0: + return False + interest = self.balance * rate + self.balance += interest + self.transactions.append(("Interest", interest)) + return True def overdraft_protection(self, amount):