From 52b964e1510e350c8855ede18ae536cb5e1dd6d5 Mon Sep 17 00:00:00 2001 From: Sean Date: Fri, 5 Jun 2026 13:46:11 +0000 Subject: [PATCH] fix: implement account interest application --- bank.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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):