Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Explanations:

1. In line 30, p * math(rt) is wrong. “rt” is a product multiple so we have to


use asterisk (*) in between r and t in order to multiply r and t.
2. In the function get_car_payment(), there’s no else statement handling
the actual task of get_car_payment - to give the user the estimated car
payment he/she has to make. So, below the if condition where we check if
the input variables are negative, we are creating an “else” branch where
we call the calculate (l, down, apr, duration) function in order to
calculate the final monthly payment that the user has to make.
3. The calculate() function was given with wrong indentation, like it was a
continuation of the get_car_payment() function, which it wasn’t. So I have
removed the wrong indent, taken the entire function body one tab left to
its appropriate indentation.
4. I have moved the last two lines

monthly = calculate(loan,down_payment,rate,dur)
print("**Your monthly payment will be %.2f" % monthly)

into the else part I’ve discussed in (2) in order to get the total monthly
payment to be made and print it to the user.

You might also like