몇 년 동안 프로그래밍을 해왔지만 지금까지는 실제로 Python을 접한 적이 없었습니다. IDLE은 24 번째 행 (마지막 행)에 플래그를 지정하고 있습니다. :인쇄 기능에 대한 Python - 구문 오류 2.7
'''
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
마지막 인쇄 기능이 어떤 문제를 일으키는 지 알면 누구에게 알려주십시오.
글쎄, 내가 본 것 중 가장 똑똑한 것은 아니다. 감사합니다. -_- 나는 바보처럼 느낍니다. –
@JuniperAsh : 익숙해지기가 다소 어려워요. 통역사는 파싱 할 수없는 것에 빠질 때까지 계속 줄을 먹고 있습니다. 구문 오류가 있으면 먼저보아야 할 곳은 이전 행입니다. –