programming loop sample (Python)
Problem 4.) Each month, Pytho puts $$100 into her bank account at the beginning of each month. Initially, she has $$100 in the account, marking her first deposit. At the end of each month, she earns 2% interest on her current balance, before the next deposit. Then, she makes her $$100 deposit. She would like a function that gives her balance after ?n months. Complete the function below so that the function returns the final balance. Keep in mind that ?=0t=0 corresponds to the initial month, when only one $$100 deposit has been made. Thus, she will have earned interest only on her initial $$100 deposit and she will have made one more deposit of $$100 at ?=1t=1 - that is, her balance should be $$202.
final_balance(360)
OUTPUT: 6357561.75
def final_balance(n):
total = 100
for i in range(n):
total *= 1.02
total += 100
return round(total, 2)
print(final_balance(360))
programming loop sample (Python) Problem 4.) Each month, Pytho puts $$100 into her bank account at...