writing simple programs if you know little bit about financial math (or just some basic algebra)you probably realize that the loop in this design is not strictly necessarythere is formula for calculating future value in single step using exponentiation have used loop here both to illustrate another counted loopand also because this version will lend itself to some modifications that are discussed in the programming exercises at the end of the in any casethis design illustrates that sometimes an algorithmic approach to calculation can make the mathematics easier knowing how to calculate the interest for just one year allows us to calculate any number of years into the future now that we've thought the problem all the way through in pseudocodeit' time to put our new python knowledge to work and develop program each line of the algorithm translates into statement of python print an introduction (print statementsection print("this program calculates the future value"print("of -year investment "input the amount of the principal (numeric inputsection principal eval(input("enter the initial principal")input the annual percentage rate (numeric inputsection apr eval(input("enter the annual interest rate")repeat times(counted loopsection for in range( )calculate principal principal ( apr(simple assignmentsection principal principal ( aproutput the value of the principal (print statementsection print("the value in years is:"principalall of the statement types in this program have been discussed in detail in this if you have any questionsyou should go back and review the relevant descriptions notice especially the counted loop pattern is used to apply the interest formula times that about wraps it up here is the completed programfutval py program to compute the value of an investment carried years into the future def main()print("this program calculates the future value"print("of -year investment "