Demo entry 6623886

fv

   

Submitted by ksp on Jun 11, 2017 at 13:25
Language: Python. Code size: 690 Bytes.

#FV Calculator
PV = float(input("PV: "))
PMT = float(input("PMT: "))
N = float(input("N: "))*12.0
r = float(input("r: "))/100
i = 1
Principal = [PV+PMT]
Return = []
Initial = PV
print("")
print("::::::::::::::::::::::")
         
while i <= N:
    if i > 1:
        Principal += [PV + (PMT*i)]
    EndBalance = (Initial+PMT)*(1+(r/12))
    print("Month "+str(i)+": ",end='')
    print("Initial = "+str(round(Initial,2)), end='')
    print("/ Saving = "+str(PMT), end='')
    print("/ Ending Balance = "+str(round(EndBalance,2)))
    Return += [round(EndBalance,1)]
    Initial = EndBalance
    i += 1

print("::::::::::::::::::::::")
print(Principal)
print(Return)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).