# File: Futurevalue.py # A simple program illustrating the future value of a savings account in 10 years def main(): p = eval(input ("Enter the initial principal amount in the savings account: ")) apr = eval(input ("Enter the annual interest rate: " )) for i in range(10): p = p*(1 + apr) print("The value in 10 years is:", p) main()
how do i rewrite this code to give me 10 outputs
Messages In This Thread |
how do i rewrite this code to give me 10 outputs - by BlackPimpernel - Mar-29-2018, 02:26 AM
RE: how do i rewrite this code to give me 10 outputs - by Larz60+ - Mar-29-2018, 04:24 AM
RE: how do i rewrite this code to give me 10 outputs - by BlackPimpernel - Mar-29-2018, 11:29 AM
|
Users browsing this thread: 2 Guest(s)