У меня проблема с моим простым кодом, предполагающим, что это ипотечный калькулятор, в котором все ставки от 0,03 до 0,18 указаны в таблице.Вот мой код и ошибка.
l = 350000 #Loan amount
n = 30 #number of years for the loan
r = [0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.10,0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18] #interest rate in decimal
n = n * 12
a = l
int1 = 12
u = [x / int1 for x in r]
D = (((u+1)**n)-1) /(u*(u+1)**n)
z = (a / D)
print(z)
File "test.py", line 23, in <module>
D = (((u+1)**n)-1) /(u*(u+1)**n)
TypeError: can only concatenate list (not "int") to list
Спасибо