can someone help me with the formula to use with python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

can someone help me with the formula to use with python

Build a function retirement_age(PMT, i, FV, start_age) that calculates the (whole) age at which your customer can retire, if they: invest an amount, PMT at the END of every YEAR (with the first payment made exactly one year from now), at an interest rate of i% per year, compounded annually. They require an amount of AT LEAST FV in order to be able to afford retirement. They just turned start_age years old. IMPORTANT: Your function may not call any of the other functions you've defined in this project (i.e. you may not call savings_calculator(PMT, n, i) or retirement_savings(PMT, i, start_age, end_age) inside this function) You can assume that start_age is a positive integer. ### START FUNCTION 3 def retirement_age(PMT, i, FV, start_age): # YOUR CODE HERE return int(age) ### END FUNCTION 3 IMPORTANT: Your function needs to return an int value rounded to 2 decimal places. If your answer is not rounded correctly to 2 decimal places, you will receive 0 for the question. Make sure that the following tests all give a True result: retirement_age(20000, 0.1, 635339.63, 20) == 35 retirement_age(10000, 0.1, 572749.99, 40) == 60

24th Sep 2018, 12:33 PM
Thendo
1 Answer
- 1
This seems like a homework assignment. Please post what you've done so far and what exactly you're stuck on.
24th Sep 2018, 8:29 PM
JME