I want to add a total paid variable to my code, but i couldnt think of any formula to sum the minimum payments and give me a total, my code is program to calculate the credit card balance after one year if a person only pays the minimum monthly payment required by the credit card company each month. and i want that at the end it said like how much have you paid over the year

balance = 5000.00
monthlyPaymentRate = 0.02
annualInterestRate = 0.18
interest = annualInterestRate * balance

monthly_interest_rate = annualInterestRate / 12
month = 1

while (month < 13):

 minumi_monthly_paymente =  monthlyPaymentRate * balance
 monthly_unpaid_balance = balance - minumi_monthly_paymente
 updated_balance_each_month = monthly_unpaid_balance + (monthly_interest_rate * monthly_unpaid_balance)
 unpaidbalance = balance - minumi_monthly_paymente



 TotalPaid= minumi_monthly_paymente 


 print "month: " + str(month)
 print "minumum month paymente: " + str(round(minumi_monthly_paymente, 2))
 print "Remaining balance: " + str(round(unpaidbalance, 2))
 balance = unpaidbalance + monthly_interest_rate * unpaidbalance 
 month = month + 1

print "Total paid:"  
print "Remaining balance: " + str(round(unpaidbalance))

I think you are better to figure it yourself and honor the Honor Code

Luck with MITx 6.00x, just finished it myself as a refresher.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.