For some background, I have been programming for many years, but never really touched Python until now, I am unsure of what is going wrong here, IDLE is flagging line 24 (last line):
'''
Test Cases
'''
balance = 4213
annualInterestRate = 0.2
monthlyPaymentRate = 0.04
'''
Variables
'''
previousBalance = 0
monthlyInterestRate = 0
minMonthlyPayment = 0
totalPaid = 0
m = 1
while (m != 12):
monthlyInterestRate = annualInterestRate / 12
minMonthlyPayment = monthlyPaymentRate * previousBalance
balance = (previousBalance - minMonthlyPayment) * (1 + monthlyInterestRate)
totalPaid = totalPaid + minMonthlyPayment
previousBalance = balance
m += 1
print('Month: ' + str(m))
print('Minimum monthly payment: ' + str(minMonthlyPayment))
print('Total paid: ' + str(round(totalPaid, 2))
print('Remaining balance: ' + str(round(balance, 2)) #Flagging Here
If anyone has any ideas on why the last print function would be causing any issues, please let me know.
You left out a parentheses at the end of line 23.