python typeerror* wants int_Python TypeError:不支持-:“int”和“function”的操作数类型...

我是一个Python初学者,正在做一个作业。即使在研究了错误并应用了建议的修复方法之后,我仍然会得到TypeError: unsupported operand type(s) for -: 'int' and 'function'。我不想找任何人给我一个解决方案,但我希望再看一眼。我错过了什么,但我不知道。这是我遇到问题的代码部分:month = 0

interestYDT = 0

balance = int(raw_input ("Enter balance on credit card: "))

annualInterestRate = float(raw_input ("Enter annual interest rate as a decimal: "))

monthlyPaymentRate = float(raw_input ("Enter minimum monthly payment rate as a decimal: "))

previousbalance = balance

#

def monthlyInterestRate(annualInterestRate):

return float(annualInterestRate/12)

#

if month <= 12:

def minimumMonthlyPayment(previousbalance):

return (previousbalance * monthlyPaymentRate)

def monthlyInterest(monthlyInterestRate):

return (1 + monthlyInterestRate)

minMonPay = minimumMonthlyPayment

monInt = monthlyInterest

newbalance = ((previousbalance - minMonPay) * (monInt))

interestYDT = (interestYTD + montInt)

previousbalance = (newbalance)

print ''

print ('Month:' (month))

print ('Minimum monthly payment: $ ' (round(minimumMonthlyPayment, 2)))

print ('Remainging balance: $ ' (round(newbalance, 2)))

print ' '

month = (month + 1)

这就是我得到的全部错误:Traceback (most recent call last):

File "C:/Users/Karla/Documents/_MIT 600X Introduction to CS and Prog/Assignments/Week2/kmarciszewski_week2_Problemset_Problem1.py", line 33, in

newbalance = ((previousbalance - minMonPay) * (monInt))

TypeError: unsupported operand type(s) for -: 'int' and 'function'

我真的很感激你的洞察力。谢谢您。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值