Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def future_value(P, i, t):
- F = P * (1+i)**t
- return F
- def main():
- P = float(input("Please enter the amount of money that you plan to invest:"))
- while(True):
- i = float(input("\nPlease enter the monthly interest rate (a value between 0 and 1):"))
- if(i > 0 and i < 1):
- break
- else:
- print("Value of i should be between 0 and 1, please try again!")
- t = int(input("\nPlease enter the total number of months that you plan to keep your money invested:"))
- F = future_value(P,i,t)
- print("\nThe future value of your money is:"+str(F))
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement