+ 3
Something with python
In sololearn code playground, you dont use this thing “>>>” at the start of some lines, but in other compilers would I have to do that?
4 odpowiedzi
+ 3
No, you should never add “>>>”
+ 3
">>>" is a just visual prompt used in the interpreter, like in the terminal or command shell (typically the current path).
+ 1
You only use the >>> when using an interpreter.
But on the playground, you don't need those
0
Your function may not call any of the other functions you've defined in this project.
Assume that start_age is an int value, and start_age < 65.
Just like in Function 4, calculate the loan as the present value of the future down-payments on the loan, discounted at an interest rate of i% per year. (Use the present value of an annuity formula, a.k.a. discounted cash flow valuation - https://www.investopedia.com/walkthrough/corporate-finance/3/discounted-cash-flow/introduction.aspx)
### START FUNCTION 5
def maximum_home_loan_with_age(PMT, i, n):
# YOUR CODE HERE:
# FV = some formula
PV = PMT /(1 + i/n)**n
return PV
maximum_home_loan_with_age(15000*12, 0.1045, 35)
### END FUNCTION 5
162164.70959859752
IMPORTANT:
Your function needs to return an float value correctly 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:
maximum_home_loan_with_age(15000*12, 0.1045, 35)
maximum_home_loan_with_age(15000*12, 0.1045, 35) == 1635153.79
False
maximum_home_loan_with_age(15000*12, 0.1045, 40) == 1578934.73
False