
Patrick B. answered 04/11/21
Math and computer tutor/teacher
principal = input(" Please input the principal :>")
interestRate = 0
if float(principal)>=20000:
interestRate = 0.04
else:
interestRate=0.03
nYears = input("Input # of years :>")
print(" YEAR PRINCIPAL INTEREST EARNED NEW PRINCIPAL")
for i in range(int(nYears)):
interestEarned = float(principal)*float(interestRate)
newPrincipal = float(principal) + float(interestEarned)
print(str(i+1)+ " " + str(principal) + " " + str(interestEarned) + " " + str(newPrincipal))
principal = newPrincipal