該代碼只是給出貸款支付的月數。類型錯誤:浮動不可回叫
import sys
loanAmt = input("enter the amount of loan you want : ")
r = input("enter the rate of interest : ")
numOfPayments = input("enter number of payments : ")
month = loanAmt (r * (1+numOfPayments)/((1+r) * (numOfPayments-1)))
print(month)
錯誤:
TypeError: 'float object is not callable '
我不從這個代碼得到這個錯誤,我得到'類型錯誤:不支持的操作數類型(S )爲+:'int'和'str',因爲input()返回一個字符串。 – cdarke