我有这个代码:
balance = 4213
annualInterestRate = 0.2
monthlyPaymentRate = 0.04
monthly_interest_rate = annualInterestRate / 12.0
for counter in range(1, 12):
payment = monthlyPaymentRate * balance
monthly_unpaid_balance = balance - payment
balance = monthly_unpaid_balance + (monthly_interest_rate * monthly_unpaid_balance)
print('Month: {}\nMinimum monthly payment: {}\nRemaining balance:{}'.format(
counter, round(payment, 2), round(balance, 2)))
我如何计算总支付(所有最低每月支付的总和)?