I'm having an issue with my simple code that is suppose to be a mortgage calculator where all the rates from 0.03 to 0.18 are listed in a table. Here is my code and error.
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
Thanks