Saturday, 19 February 2022

Future Value Python Program

 CODE :We want to develop a program to determine the future value of an investment.

def main () : 

    print ("This program calculates the future value") 

    print ("of a 10-year investment.") 

    principal = eval (input ("Enter the initial principal: $") ) 

    apr = eval (input ("Enter the annual interest rate: ") ) 

    for i in range (10) : 

        principal = principal * (1 + apr) 

        print ("The value in 10 years is: $", principal) 

main ()

save above program as futval.py


SCREENSHOT



No comments:

Post a Comment