我很难编写一个程序来计算12个月后信用卡债务的余额。这是我目前所拥有的,但是当我运行程序时,是说“名称RBm未定义”。在
x = float(raw_input('What is the outstanding balance on the credit card?'))
y = float(raw_input('What is the annual interest rate?'))
z = float(raw_input('What is the minimum monthly payment rate?'))
for n in range(1, 13):
m = n-1
RB0 = x
MMPn = RBm*z
IP = (y/12)*x
PPn = MMPn - IP
RBn = RBm - PPn
print 'Month:', n
print 'Minimum Monthly Payment:', MMPn
print 'Principal Paid:', PPn
print 'Remaining Balance:', RBn
每月支付本金,剩余利息为每月支付,剩余利息为每月支付。 我想出了这个方法,我可以用不同的数字复制粘贴12次,但是我希望它更高效,所以我想出了上面的代码。在
^{pr2}$
你必须告诉你的程序什么是RBm。在
你先在这里用:
你的程序不知道如何处理这个变量。在
相关问题 更多 >
编程相关推荐