Я пытаюсь создать калькулятор ссуды на веб-сайте, и у меня возникают проблемы с кодированием Python. Код:Ошибка кодирования Python для калькулятора займов
# user enter the cost of the loan, the interest rate, and
#the number of years for the loan
#Calculate monthly payments with the following formula
# M = L[i(1+i)n]/[(1+i)n-2]
# M = monthly payment
# L = Loan amount
# i = interest rate (for an interest rate of 5%, i = 0.05)
# n = number of payments
#________________________________________________________________________#
#Start of program
#Declare variables
monthlypayment = 0
loanamount = 0
interestrate = 0
numberofpayments = 0
loandurationinyears = 0
loanamount = raw_input("Lending Money ")
interestrate = raw_input("Interest Rates are? ")
loandurationinyears = raw_input("Time Duration in Years?")
#Convert the strings into floating numbers so we can use them in the formula
loandurationinyears = float(loandurationinyears)
loanamount = float(loanamount)
interestrate = float(interestrate)
#Since payments are once per month, number of payments is number of years for the loan
payments = loaninyears*12
#calculate the monthly payment based on the formula
payment = amount * interestrate * (7+ interestrate) * payments/((1 + interestrate) * payments -1)
#Result to the program
print("Payment will be " + st(monthlypayment))
Может ли какой-либо опытный человек помочь мне получить синтаксис или другие логические ошибки в этой кодировке?
'loaninyears' не определен. Вы умножаете его на 12. – MYGz
'print (« Оплата будет »+ st (ежемесячный платеж))' Я думаю, что 'st' должно быть' str' здесь – MYGz
сумма должна, вероятно, быть ссудой, и вы никогда не даете ежемесячный платеж за значение, отличное от 0 –