Question: Python help!! I need help calculating the end date of a loan. I'm really new to programming so I'm having a lot of trouble. This
Python help!! I need help calculating the end date of a loan. I'm really new to programming so I'm having a lot of trouble. This is what i have so far. any help is really appreciated!!
def main(): #function variables purchase_price = input("Please input original purchase price: ") down_payment = input("Please input total down payment: ") APR = float(input("Please input APR: ")) periods_year = input("Please input the number of annual payments: ") term = float(input("Please input loan length in years: ")) first_payment = input("Please input date of first payment in form MM/DD/YYYY: ") first_payment.split("/") day,month,year = first_payment("/") day = int(day) month = int(month) year = int(year) #part 1 calculations with main variables total_payments = float(term)-float(down_payment) loan_amount = float(purchase_price)*float(down_payment) main()
def loanCalc(): #interest charged per period r = (APR)/(period_year) #amount paid in each period P = (r*loan_amount)/(1-(1+r)**(-(total_payments)) #amount paid over life of loan final_total = P*total_payments #loan end date
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
