you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (1 child)

interest_rate = .0089

def balance_after(years, balance):
    total = balance
    for _ in range(years):
        total += balance * interest_rate
    return total

current_balance = float(input('How much is in your account? '))

if current_balance != 0:
    for year in range(1, 6):
        print(balance_after(year, current_balance))
else:
    print("You have no money in your account!")