Python贷款结束日期

时间:2018-02-16 04:46:40

标签: python-3.x python-2.7 math banking

我很难理解下一步应该去哪里。我应该计算贷款的结束日期,其中期限日期可能因情况而异。我已经读过关于日期时间的东西,但是我的教授说我们不应该使用它,而应该只分割字符串。我已经完成了但我真的很困惑,从这里开始下一步。这就是我的开始日期。

  print("This program is used to analyze commercial real estate loans.")
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

0 个答案:

没有答案