Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/326.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2中的语法错误_Python - Fatal编程技术网

Python 2中的语法错误

Python 2中的语法错误,python,Python,我有作业要做,我做了。我95%确信这是一个正确的代码。我不知道为什么,但不幸的是,我在其中一行中出现了语法错误。这是我的密码: month = 1 totalPaid = 0 while month <= 12: print('Month: ' + str(month)) print('Minimum monthly payment: ' + str(round(monthlyPaymentRate * balance), 2) balance = round((b

我有作业要做,我做了。我95%确信这是一个正确的代码。我不知道为什么,但不幸的是,我在其中一行中出现了语法错误。这是我的密码:

month = 1
totalPaid = 0
while month <= 12:
    print('Month: ' + str(month))
    print('Minimum monthly payment: ' + str(round(monthlyPaymentRate * balance), 2)
    balance = round((balance - (monthlyPaymentRate * balance)) * (1 + (annualInterestRate/12)),2)
    print('Remaining balance: ' + str(round(balance, 2)))
    month = month + 1
    totalPaid = totalPaid + round((monthlyPaymentRate * balance), 2)
print('Total paid: ' + str(totalPaid))
print('Remaining balance: ' + str(balance))
month=1
支付总额=0
而月份
有三个打开的参数,但有两个关闭的参数


有三个开放区,但有两个关闭区。

家庭作业标签正在逐步淘汰;请不要再将其添加到帖子中。-1以确保Python解释器对Python语法的了解比您少95%。找一个能匹配帕伦斯的编辑。谢谢你,先生!先生,我可以再要一份吗?
家庭作业
标签正在逐步取消;请不要再将其添加到帖子中。-1以确保Python解释器对Python语法的了解比您少95%。找一个能匹配帕伦斯的编辑。谢谢你,先生!先生,我可以再来一杯吗?阿莱鲁哈。非常感谢你,阿莱鲁哈。非常感谢你。
print('Minimum monthly payment: ' + str(round(monthlyPaymentRate * balance), 2)